| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157773 | 张蔚林 | 判断素数II | C++ | Accepted | 9 MS | 272 KB | 261 | 2026-08-17 14:06:41 |
#include<bits/stdc++.h> using namespace std; bool t(int x){ for(int i=2;i<=x/2;i++){ if(x%i==0) return false; } return true; } int main(){ int n,h=0; cin>>n; for(int i=2;i<=n;i++){ if(t(i))h++; } cout<<h<<endl; return 0; }