【题目描述】
【输入】
【输出】
【输入样例】
10
【输出样例】
#include<iostream> using namespace std; int su(int x){ for(int i=2;i<=x/2;i++)if(x%i==0) return 0; return 1;//是质数 } int n,s=0; int main(){ cin>>n; for(int i=2;i<=n;++i)if(su(i))s++; cout<<s; return 0; }//OK
Powered by 孙会中 @ 2024-2026【 www.sunhuizhong.cn 】All rights reserved
访问统计:387660 本月:27 上月:1061 今日:6 昨日:3 当前在线:1人