| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 82510 | sh25_wuyy | 素数个数 | C++ | Accepted | 0 MS | 240 KB | 274 | 2026-01-15 18:18:45 |
#include<bits/stdc++.h> using namespace std; bool pm(int x){ bool flag=1; if(x==2)flag=1; else{ for(int i=2;i<x;i++){ if(x%i==0) flag=0; }return flag; } }int main(){ int n,cnt=0; cin>>n; for(int i=2;i<=n;i++){ if(pm(i))cnt++; }cout<<cnt; return 0; }