Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
8423 谢锦卓 判断素数II C++ Compile Error 0 MS 0 KB 288 2025-12-20 20:05:50

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; bool a(int n){ for(int i=2;i<=sqrt(n);i++){ if(n%i==0) return 0; } } } int main(){ int n,ans=0; cin>>n; for(int i=2;i*i<=n;i++){ if(n%i==0) ans++; } cout<<ans; return 0; }


Run Info:

Main.cc:8:1: error: expected declaration before '}' token
 }
 ^
Main.cc: In function 'bool a(int)':
Main.cc:7:5: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^