| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 55832 | luchenhao2024 | 输出N以内的素数 | C++ | Accepted | 19 MS | 252 KB | 349 | 2024-11-08 15:53:06 |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; for(int i=2;i<=n;i++){ int s=0; for(int j=2;j<=sqrt(i);j++){ if(i%j==0){ s=1; break; } } if(s==0){ cout<<i<<endl; } } return 0; }