Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
148278 于墨轩 数组输出 C++ Compile Error 0 MS 0 KB 609 2026-02-10 22:58:29

Tests(0/0):


Code:

#include <iostream> #include <climits> using namespace std; int main() { const int ARRAY_SIZE = 10; int numbers[ARRAY_SIZE]; cout << "请输入10个用空格分隔的整数:" << endl; for (int i = 0; i < ARRAY_SIZE; ++i) { if (!(cin >> numbers[i])) { cerr << "错误:输入不是有效的整数,或输入数量不足" << endl; return 1; } } cout << "数组内容为:" << endl; for (int i = 0; i < ARRAY_SIZE; ++i) { cout << numbers[i] << " "; } cout << endl; } return 0; }


Run Info:

Main.cc:22:5: error: expected unqualified-id before 'return'
     return 0;
     ^
Main.cc:23:1: error: expected declaration before '}' token
 }
 ^