전체 글35 (오일러 10번) 이백만 이하 소수의 합 #include #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */void eratos(int n){bool PrimeArray[n+1];int i;int j;long long sum = 0;if(n 2017. 9. 6. (오일러 9번) a + b + c = 1000 이 되는 피타고라스 수 #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) {int x=1;int y=1;int z=1;for(x=1; x 2017. 9. 6. (오일러 8번) 1000자리 숫자 안에서 이어지는 5자리 숫자의 곱 중 최대값은? #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) {FILE *fp = fopen("a.txt", "r"); char c; int read[1000]; int cal[996]; int num; int i = 0; int j = 0; int k = 0; int max = 0; if(fp == NULL) { printf("file open error ! \n"); return 0; } while((c = fgetc(fp)) != EOF) { printf("%c", c); int num = .. 2017. 9. 6. (오일러 7번) 10001번째의 소수 // 오일러 7번 #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) {int i = 2;int j;int box = 0;int count = 0;int count2 = 0; while(true){for(j=1; j 2){count = 0;}else{count = 0;box = i;count2++; } i++; if(count2 == 10001) { break;} }printf("%d", box);return 0;} 2017. 9. 6. 이전 1 2 3 4 5 6 7 8 9 다음