zj3t

email: euntaejang@gmail.com

Latest Posts

Project Euler-5

By 오후 1:04

4번보다는 쉬운 문제였던 것같습니다.




#include <stdio.h>
int main()
{
unsigned long long ex = 1;
unsigned long long i = 1;
int count = 0;

for (int a = 1; a <= 20; a++)
{
ex *= a;
}
while (i <= ex) {
if (ex%i == 0) {
for (int a = 1; a <= 20; a++) {
if (i%a == 0) {
count = count + 1;
}
}
if (count == 20) {
printf("%I64u\n", i);
}
}
count = 0;
i++;
}

return 0;
}


You Might Also Like

0 개의 댓글