洛谷 P5723 【深基4.例13】质数口袋
更多...
#include <luogu.h>
|
static int | main (istream &cin, ostream &cout) |
|
洛谷 P5723 【深基4.例13】质数口袋
在文件 luogu.h 第 291 行定义.
◆ main()
int luogu::P5723::main |
( |
istream & | cin, |
|
|
ostream & | cout ) |
|
static |
在文件 luogu.cpp 第 775 行定义.
775 {
776 unsigned int l;
777 unsigned int sum = 0;
778 int count = 0;
779 cin >> l;
780 for(unsigned int i = 2; i <= l; i++) {
782 for(unsigned int j = 2; j <= sqrt(i); j++) {
783 if(i % j == 0) {
785 break;
786 }
787 }
788 if(is_prime) {
789 sum += i;
790 if(sum <= l) {
791 cout << i << endl;
792 count++;
793 } else {
794 break;
795 }
796 }
797 }
798 cout << count << endl;
799 return 0;
800 }
被这些函数引用 luogu::TEST().
该类的文档由以下文件生成: