Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
97531 程余天皓 不吉利的数 C++ Compile Error 0 MS 0 KB 468 2024-11-16 10:33:24

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { int n,m,cnt=0; cin>>n>>m; for(int i=n;i<=m;i++){ int g=i%10; int s=i/10%10; int b=i/100%10; int q=i/1000%10; int w=i/10000%10; int sw=i/100000%10; int bw=i/1000000%10; if(g==4||s==4||b==4||q==4||w==4||sw==4||bw==4){ cnt++ }else if((g==2&&s==6)||(s==2&&b==6)||(b==2&&q==6)||(q==2&&w==6)||(w==2&&sw==6)||(sw==2&&bw==6)){ cnt++; } } cout<<m-n+1-cnt; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:16:3: error: expected ';' before '}' token
   }else if((g==2&&s==6)||(s==2&&b==6)||(b==2&&q==6)||(q==2&&w==6)||(w==2&&sw==6)||(sw==2&&bw==6)){
   ^