Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
109806 胡海峰老师 找最大的数 C++ Accepted 1 MS 272 KB 335 2025-02-12 09:40:35

Tests(10/10):


Code:

#include <iostream> using namespace std; int main(){ int a[11]; // a[0] , a[1]-a[10] int maxn=0,pos=0; for(int i=1;i<=10;i++) { cin>>a[i]; } for(int i=1;i<=10;i++) { if(a[i]>maxn) { maxn = a[i]; pos = i; } } cout<< pos; return 0; } /* Input 5 4 3 2 1 10 8 9 7 6 Output 6 */