Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
140110 刘梓含 19众数 C++ Compile Error 0 MS 0 KB 312 2025-12-13 15:29:02

Tests(0/0):


Code:

include<bits/stdc++.h> using namespace std; int main(){ int a=0,b[4] = {0},n=0; while(a != -1) { cin >> a; if(a >= 1 && a <= 3) { b[a]++; } n++; } for(int i = 1;i <= 3;i++) { if(b[i] > max) { max = b[i]; x = i; } } } cout<<x; return 0;


Run Info:

Main.cc:1:1: error: 'include' does not name a type
 include
 ^
Main.cc: In function 'int main()':
Main.cc:9:5: error: 'cin' was not declared in this scope
     cin >> a;
     ^
Main.cc:18:13: error: 'max' was not declared in this scope
   if(b[i] > max)
             ^
Main.cc:21:4: error: 'x' was not declared in this scope
    x = i;
    ^
Main.cc: At global scope:
Main.cc:25:4: error: 'cout' does not name a type
    cout<