Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
107761 | 糜宗易 | 18插队喝水 | C++ | Compile Error | 0 MS | 0 KB | 938 | 2025-01-18 12:08:07 |
#include<bits/stdc++.h> using namespace std;#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n+1]; for (int i = 1; i <= n; i++) { cin >> a[i]; } int b; cin >> b; for (int i = n - 1; i < n; i--) { a[i] = a[i-1]; } a[4]=b; for (int i = 0; i <= n; i++) { cout << a[i] << " "; } return 0; } int main() { int n; cin >> n; int a[n]; for (int i = 1; i <= n; i++) { cin >> a[i]; } int b; cin >> b; for (int i = n - 1; i < n; i--) {#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n+1]; for (int i = 1; i <= n; i++) { cin >> a[i]; } int b; cin >> b; for (int i = n - 1; i < n; i--) { a[i] = a[i-1]; } a[4]=b; for (int i = 0; i <= n; i++) { cout << a[i] << " "; } return 0; } a[i + 1] = a[i]; } b = a[4]; for (int i = 0; i <= n; i++) { cout << a[i] << " "; } return 0; }
Main.cc:2:21: error: stray '#' in program using namespace std;#include ^ Main.cc:31:35: error: stray '#' in program for (int i = n - 1; i < n; i--) {#include ^ Main.cc:2:22: error: 'include' does not name a type using namespace std;#include ^ Main.cc: In function 'int main()': Main.cc:22:5: error: redefinition of 'int main()' int main() { ^ Main.cc:4:5: note: 'int main()' previously defined here int main() { ^ Main.cc:31:36: error: 'include' was not declared in this scope for (int i = n - 1; i < n; i--) {#include ^ Main.cc:31:44: error: 'bits' was not declared in this scope for (int i = n - 1; i < n; i--) {#include ^ Main.cc:31:49: error: 'stdc' was not declared in this scope for (int i = n - 1; i < n; i--) {#include ^ Main.cc:32:1: error: expected primary-expression before 'using' using namespace std; ^ Main.cc:33:12: error: a function-definition is not allowed here before '{' token int main() { ^ Main.cc:58:1: error: expected '}' at end of input } ^ Main.cc:58:1: error: expected '}' at end of input