Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
84075 石晋骁 判断素数II C++ Accepted 15 MS 272 KB 298 2024-07-15 11:26:25

Tests(10/10):


Code:

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