Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
92477 | 石水生 | 找最大的数 | C++ | Compile Error | 0 MS | 0 KB | 320 | 2024-10-05 14:04:56 |
#include <bits/stdc++.h> using namespace std; int main(){ int number[10]; int max=0,maxi=0; for(int i=0;i<10;i++){ cin>>number[i]; } for(int i=0;i<10;i++){ if(number[i]>max){ max=number[i]; } } for(int i=0;i<10;i++){ if(max==number[i]) {cout<<i+1; return; } } }
Main.cc: In function 'int main()': Main.cc:17:3: error: return-statement with no value, in function returning 'int' [-fpermissive] return; ^ Main.cc:5:12: warning: unused variable 'maxi' [-Wunused-variable] int max=0,maxi=0; ^