Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
131525 李朋秦 判断素数II C++ Wrong Answer 2 MS 280 KB 289 2025-09-27 14:49:55

Tests(0/10):


Code:

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


Run Info:

------Input------
302
------Answer-----
62
------Your output-----
150