6 条题解
-
0
又双叒叕是一道水题
就一道水题,怎么把楼下某大佬的质数筛给轰出来了???
冷知识: 也能过
详见代码:#include<iostream> #include<cmath> #define QwQ return 0; using namespace std; int n,cnt; int main(){ cin>>n; for(int i=2;i<=n;i++){ bool flag=true; for(int j=2;j<=sqrt(i);j++){ if(i%j==0){ flag=false; break; } } if(flag)cnt++; } cout<<cnt; QwQ }
信息
- ID
- 42
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 5
- 标签
- 递交数
- 73
- 已通过
- 31
- 上传者