Run ID:67470
提交时间:2024-03-16 16:08:13
#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; }