Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
112095 何松羽 100至200之间的所有素数 C++ Compile Error 0 MS 0 KB 282 2025-03-08 13:24:20

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n,flag; for (int j = 100; j <=200 ; j++) { n=j; for (int i = 2; i < n ; i++) { if (n % i == 0) { a = 1; break; } } if (a == 1) { cout<<n << endl } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:9:6: error: 'a' was not declared in this scope
      a = 1;
      ^
Main.cc:14:8: error: 'a' was not declared in this scope
    if (a == 1) {
        ^
Main.cc:16:4: error: expected ';' before '}' token
    }
    ^
Main.cc:4:8: warning: unused variable 'flag' [-Wunused-variable]
  int n,flag;
        ^