Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
157771 张蔚林 判断素数II C++ Compile Error 0 MS 0 KB 244 2026-08-17 14:04:06

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; bool t(int x){ for(inxt i=2;i<=x/2;i++){ if(%i==0) return false; } return true; } int main(){ int n,h=0; cin>>n; for(int i=2;i<=n;i++){ if(t(i))c++; } return 0; }


Run Info:

Main.cc: In function 'bool t(int)':
Main.cc:4:6: error: 'inxt' was not declared in this scope
  for(inxt i=2;i<=x/2;i++){
      ^
Main.cc:4:15: error: 'i' was not declared in this scope
  for(inxt i=2;i<=x/2;i++){
               ^
Main.cc:5:6: error: expected primary-expression before '%' token
   if(%i==0) return false;
      ^
Main.cc: In function 'int main()':
Main.cc:13:11: error: 'c' was not declared in this scope
   if(t(i))c++;
           ^
Main.cc:10:8: warning: unused variable 'h' [-Wunused-variable]
  int n,h=0;
        ^