Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7477 | 赖梓乐 | 12满足条件的四位数 | C++ | Compile Error | 0 MS | 0 KB | 1388 | 2025-04-26 21:01:57 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ //int s,d,q,w,e,r,f; //cin>>s; //for(;s<=d;s++,int a){ // r=a%10 //e=a/10%10 //w=a/100%100 //q=a/1000%10; //} int n,temp,cnt=0; cin>>n; for(int i=1;i<=n;i++){ cin>>temp; int g=temp%10; int s=temp/10%10; int b=temp/100%10; int q=temp/1000%10; if(g-s-b-q>0){#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ //int s,d,q,w,e,r,f; //cin>>s; //for(;s<=d;s++,int a){ // r=a%10 //e=a/10%10 //w=a/100%100 //q=a/1000%10; //} int n,temp,cnt=0; cin>>n; for(int i=1;i<=n;i++){ cin>>temp; int g=temp%10; int s=temp/10%10; int b=temp/100%10; int q=temp/1000%10; if(g-s-b-q){ cout<< cnt++; } } cout<<cnt; return 0; }
Main.cc:24:23: error: stray '#' in program if(g-s-b-q>0){#include // cin\cout\endl ^ Main.cc: In function 'int main()': Main.cc:24:24: error: 'include' was not declared in this scope if(g-s-b-q>0){#include // cin\cout\endl ^ Main.cc:24:40: error: expected primary-expression before '>' token if(g-s-b-q>0){#include // cin\cout\endl ^ Main.cc:29:1: error: expected primary-expression before 'using' using namespace std; ^ Main.cc:29:1: error: expected ';' before 'using' Main.cc:30:11: error: a function-definition is not allowed here before '{' token int main(){ ^ Main.cc:69:1: error: expected '}' at end of input } ^ Main.cc:69:1: error: expected '}' at end of input Main.cc:16:16: warning: unused variable 'cnt' [-Wunused-variable] int n,temp,cnt=0; ^ Main.cc:69:1: error: expected '}' at end of input } ^