Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
67202 游四鑫 判断素数II C++ Compile Error 0 MS 0 KB 248 2024-03-15 22:03:06

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int s (int w){ cin>>w; for(int i=2;i<=w/2;i++){ if(s%i!=0)return 1; } return 0; } int main(){ for(int i=2;i<=w;i++){ if(a(i)) v++; } cout << v; return 0; }


Run Info:

Main.cc: In function 'int s(int)':
Main.cc:7:10: error: invalid operands of types 'int(int)' and 'int' to binary 'operator%'
     if(s%i!=0)return 1;
          ^
Main.cc: In function 'int main()':
Main.cc:15:16: error: 'w' was not declared in this scope
 for(int i=2;i<=w;i++){ 
                ^
Main.cc:16:8: error: 'a' was not declared in this scope
  if(a(i)) v++; 
        ^
Main.cc:16:11: error: 'v' was not declared in this scope
  if(a(i)) v++; 
           ^
Main.cc:18:9: error: 'v' was not declared in this scope
 cout << v; 
         ^