| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 140698 | 翁思宸 | 判断素数II | C++ | Accepted | 15 MS | 272 KB | 452 | 2025-12-19 18:21:53 |
//1498 判断素数II #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int use(int x){ if(x<2){ return 0; } for(int i=2;i<=(x-1);i++){ if(x%i==0){ return 0; } } return 1; } int main(){ int n,s=0; cin>>n; for(int i=2;i<=(n-1);i++){ if(use(i)==1){ s++; } } cout<<s; return 0; }