| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 139518 | 唐诗阳 | 判断素数II | C++ | Wrong Answer | 0 MS | 268 KB | 570 | 2025-12-07 14:52:14 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int zhi(int a){ int s=0; for(int i=2;i<a;i++){ if(a%i==0){ s=0; } else{ s=1; } } return s; } int main(){ int n,sum=0; cin>>n; for(int i=2;i<=n;i++){ if(zhi(i)==0) sum++; } cout<<sum; return 0; }
------Input------
302
------Answer-----
62
------Your output-----
1