| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 164986 | 王梓轩 | 判断素数II | C++ | Accepted | 2 MS | 264 KB | 329 | 2026-11-08 15:46:21 |
#include<bits/stdc++.h> using namespace std; bool ss(int n) { if(n==1) return false; for(int i=2;i<=sqrt(n);i++) { if(n%i==0) { return false; } } return true; } int main() { int s=0; int n; cin>>n; for(int i=2;i<=n;i++) { if(ss(i)) { s++; } } cout<<s<<endl; return 0; }