// 오일러 7번
#include <iostream>
/* 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<=i; j++)
{
if(i % j == 0)
{
count++;
}
}
if(count > 2)
{
count = 0;
}
else
{
count = 0;
box = i;
count2++;
}
i++;
if(count2 == 10001)
{
break;
}
}
printf("%d", box);
return 0;
}
'공부' 카테고리의 다른 글
| (오일러 9번) a + b + c = 1000 이 되는 피타고라스 수 (0) | 2017.09.06 |
|---|---|
| (오일러 8번) 1000자리 숫자 안에서 이어지는 5자리 숫자의 곱 중 최대값은? (0) | 2017.09.06 |
| HashMap 을 이용한 정보 출력 (0) | 2017.06.01 |
| runnable 인터페이스 예시 (0) | 2017.06.01 |
| git (0) | 2017.05.17 |
댓글