| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157769 | 李沐阳 | 判断素数II | C++ | Accepted | 141 MS | 272 KB | 298 | 2026-08-17 13:42:08 |
#include<bits/stdc++.h> using namespace std; bool w(int q){ bool a; int s=0; for(int i=1;i<=q;i++){ if(q%i==0) s++; } if(s>2) a=false; else a=true; return a; } int main(){ int n,sum=0; cin>>n; for(int i=2;i<=n;i++){ if(w(i))sum++; } cout<<sum<<endl; return 0; }