作业题 - 输出质数个数
No testdata at current.
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
编一个程序,计算1∼n 范围内素数的个数。
输入
包括多组数据(不超过 100 组),每组数据仅有一个整数 n (1≤n≤500000 ),输入以 0 结束。
输出
对于每组数据输入,输出一行,为 1∼n (包括 n )之间的素数的个数。
样例
输入
1
10
65
100
0
输出
0
4
18
25
日照原始人第一届免死金牌争夺战
- Status
- Done
- Rule
- XCPC
- Problem
- 6
- Start at
- 2025-7-8 19:00
- End at
- 2025-7-8 21:00
- Duration
- 2 hour(s)
- Host
- Partic.
- 1