Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
116151 陈铎文 判断素数II C++ Accepted 2 MS 268 KB 335 2025-04-06 14:45:48

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; bool sushu(int n){ for(int i=2;i<=sqrt(n);i++){ if(n%i==0) return false; } return true; } int main(){ int a,s=0; cin>>a; for(int i=2;i<=a;i++){ if(sushu(i)){ s++; } } cout<<s; return 0; }