Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
101769 | 房知谦 | [在线测评解答教程] 求和 | C++ | Compile Error | 0 MS | 0 KB | 553 | 2024-12-18 19:12:50 |
#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 n; int a[100]; int y=0; for(int i=0;i<10000;i++){ cin>>n; if(n=="eof"){ break; } a[i]=n; } for(int o=0;o<i;o++){ for(int u=0;u<a[o];u++){ y=y+u; } } cout<<y; return 0; }
Main.cc: In function 'int main()': Main.cc:14:15: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n=="eof"){ ^ Main.cc:14:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] Main.cc:19:19: error: 'i' was not declared in this scope for(int o=0;o