| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 31062 | jaypei | 素数个数 | C++ | Accepted | 0 MS | 244 KB | 284 | 2023-11-13 21:23:14 |
#include<iostream> using namespace std; int main() { int n,cnt=0; cin>>n; for(int j=2;j<=n;j++){ int t=j; bool flag=true; for(int i=2;i<t;i++){ if(t%i==0){ flag=false; break; } } if(flag==true){ cnt++; } } cout<<cnt; return 0; }