From 5698ab4b77e86be9ff447fb9533556c5ddbc8b47 Mon Sep 17 00:00:00 2001 From: Daniele Fucini Date: Thu, 26 Sep 2019 18:08:10 +0200 Subject: [PATCH] Correct problem 52 solution --- C/p052.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C/p052.c b/C/p052.c index 5cabeba..2334845 100644 --- a/C/p052.c +++ b/C/p052.c @@ -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++;