Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
67468 黎瑾萱 判断素数II C++ Accepted 11 MS 272 KB 268 2024-03-16 16:07:19

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; bool ss(int zs){ for(int j=2;j<zs;j++){ if(zs%j==0) return 0; } return 1; } int main(){ int n,sum=0; cin>>n; for(int i=2;i<=n;i++){ if(ss(i)==1){ sum++; } } cout<<sum; return 0; }