Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
107579 郭玉洁 找最大的数 C++ Compile Error 0 MS 0 KB 456 2025-01-18 10:22:16

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i <= n - 1; i++) { cin >> a[i]; } cout << sam << " "; float p = sam * 1.0 / n; printf("%2f", p); cout << endl; int g = 0; for (int i = 0; i <= n - 1; i++) { if (a[i] > p) { g = g + a[i]; } } cout << g << endl; for (int i = 0; i <= n - 1; i++) { if (a[i] > p) { cout << a[i] << " "; } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:10: error: 'sam' was not declared in this scope
  cout << sam << " ";
          ^