Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
1715 | 孙浚轩 | 13求7个数的最大值 | C++ | Compile Error | 0 MS | 0 KB | 242 | 2023-11-04 17:53:22 |
#include<iostream> #include<cmath> using namespace std; int main() { int a,m=INT_MIN; for(int i=1,i<=7) { cin>>a; if(a>max) max=a; } cout<<pow(m,2)<<endl<<pow(m,3); return 0; }
Main.cc: In function 'int main()': Main.cc:6:13: error: 'INT_MIN' was not declared in this scope int a,m=INT_MIN; ^ Main.cc:7:18: error: expected initializer before '<=' token for(int i=1,i<=7) ^ Main.cc:7:18: error: expected ';' before '<=' token Main.cc:7:18: error: expected primary-expression before '<=' token Main.cc:7:21: error: expected ';' before ')' token for(int i=1,i<=7) ^ Main.cc:10:14: error: invalid operands of types 'int' and '' to binary 'operator>' if(a>max) ^ Main.cc:11:16: error: overloaded function with no contextual type information max=a; ^ Main.cc:7:13: warning: unused variable 'i' [-Wunused-variable] for(int i=1,i<=7) ^