Run ID:131528
提交时间:2025-09-27 14:56:49
#include<bits/stdc++.h> using namespace std; bool sum(int x){ if(x==2){ return true; }else{ for(int j=2;j<=sqrt(x);j++){ if(x%j==0) return false; else return true; } } } int main(){ int n,c=0; cin>>n; for(int i=2;i<=n;i++){ if(sum(i)){ c++; } } cout<<c; return 0; }