Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
67470 刘宇轩 判断素数II C++ Accepted 11 MS 276 KB 278 2024-03-16 16:08:13

Tests(10/10):


Code:

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