Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
92417 | 王珠潏 | 计算平均数 | C++ | Compile Error | 0 MS | 0 KB | 338 | 2024-10-03 20:07:10 |
#include<iostream> using namespace std; int main(){ int i=0,t=0,a=0; float w; char m; cin>>m; while((m=getchar())?='\n'){ if(m<0){ i++; }else{ t++; a=a+m; } } w=a/t; cout<<i<<endl; cout<<w<<endl; return 0; }
Main.cc: In function 'int main()': Main.cc:8:25: error: expected primary-expression before '=' token while((m=getchar())?='\n'){ ^ Main.cc:8:30: error: expected ':' before ')' token while((m=getchar())?='\n'){ ^ Main.cc:8:30: error: expected primary-expression before ')' token