编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#103434 | #105. zxh的继承顺位 | Compile Error | 0 | 0 ms | 0 K | C++ 11 / 423 B | 西安交通大学 | 2024-03-18 15:44:16 |
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int n;
cin >> n;
if (n == 1)
return 2;
int flag = 2;
for (int i = 3; i++) {
for (int j = 2; j < n; j++) {
if (i % j == 0) {
break;
}
}
if (j == k)
flag++;
if (flag == n)
break;
}
return i;
}
编译信息
/sandbox/1/a.cpp:8:5: error: expected primary-expression before 'int'
8 | int n;
| ^~~
/sandbox/1/a.cpp:8:5: error: expected '}' before 'int'
/sandbox/1/a.cpp:7:1: note: to match this '{'
7 | {
| ^
/sandbox/1/a.cpp:9:5: error: 'cin' does not name a type
9 | cin>>n;
| ^~~
/sandbox/1/a.cpp:10:5: error: expected unqualified-id before 'if'
10 | if(n==1)
| ^~
/sandbox/1/a.cpp:13:5: error: expected unqualified-id before 'for'
13 | for(int i=3;i++)
| ^~~
/sandbox/1/a.cpp:13:17: error: 'i' does not name a type
13 | for(int i=3;i++)
| ^
/sandbox/1/a.cpp:27:5: error: expected unqualified-id before 'return'
27 | return i;
| ^~~~~~
/sandbox/1/a.cpp:29:1: error: expected declaration before '}' token
29 | }
| ^