Correct problem 52 solution

This commit is contained in:
daniele 2019-09-26 18:08:10 +02:00
parent 3503357703
commit 5698ab4b77
Signed by: fuxino
GPG Key ID: 6FE25B4A3EE16FDA

View File

@ -10,7 +10,7 @@ int have_same_digits(int a, int b);
int main(int argc, char **argv)
{
int i, found = 0;
int i;
double elapsed;
struct timespec start, end;
@ -19,12 +19,12 @@ int main(int argc, char **argv)
i = 1;
/* Brute force approach, try every integer number until the desired one is found.*/
while(!found)
while(1)
{
if(have_same_digits(i, 2*i) && have_same_digits(i, 3*i) && have_same_digits(i, 4*i) &&
have_same_digits(i, 5*i) && have_same_digits(i, 6*i))
{
found = 1;
break;
}
i++;