| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 76896 | 黄枳润 | 14慈善募捐 | C++ | Compile Error | 0 MS | 0 KB | 449 | 2024-06-04 18:34:32 |
#include<iostream> using namespace std; int main() { double y,x; cin>>x; if(x<5){ y=-x+2.5; }else if(x<10){ y=2-1.5*(x-3)*2; }else{ y=x/2-1.5; } printf("%.3lf",y); */ int i,sum=0,j,l; for(j=1;j<=1000;j++){ cin>>i; sum+=i; if(sum>=100000){ break; } } printf("%d %.2lf",j,sum*1.0/j); return 0; }
Main.cc: In function 'int main()':
Main.cc:15:6: error: expected primary-expression before '/' token
*/
^
Main.cc:16:5: error: expected primary-expression before 'int'
int i,sum=0,j,l;
^
Main.cc:17:9: error: 'j' was not declared in this scope
for(j=1;j<=1000;j++){
^
Main.cc:18:14: error: 'i' was not declared in this scope
cin>>i;
^
Main.cc:19:9: error: 'sum' was not declared in this scope
sum+=i;
^
Main.cc:24:23: error: 'j' was not declared in this scope
printf("%d %.2lf",j,sum*1.0/j);
^
Main.cc:24:25: error: 'sum' was not declared in this scope
printf("%d %.2lf",j,sum*1.0/j);
^