Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3131 | 邓小龙 | 判断素数II | C++ | Accepted | 0 MS | 268 KB | 279 | 2024-04-06 10:48:44 |
# include<iostream> using namespace std; bool a(int n){ for(int i=2;i<=n/i;i++){ if(n%i==0)return false; } return true; } int main(){ int n,l=0; cin>>n; for(int i=2;i<=n;i++){ if(a(i))l++; } cout<<l; return 0; }