Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
74367 杨珂茹 素数判断 C++ Compile Error 0 MS 0 KB 248 2024-05-25 10:03:56

Tests(0/0):


Code:

#include <iostream> #include <iomanip> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { if (n % i == 0) { c++; } } if (c == 2) { cout << "prime"; } else { cout << "not prime"; } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:4: error: 'c' was not declared in this scope
    c++;
    ^
Main.cc:13:6: error: 'c' was not declared in this scope
  if (c == 2) {
      ^