Clean code

This commit is contained in:
daniele 2019-09-25 21:00:15 +02:00
parent 42511baeee
commit 325dcc3507
Signed by: fuxino
GPG Key ID: 6FE25B4A3EE16FDA
8 changed files with 9 additions and 9 deletions

View File

@ -54,7 +54,7 @@ int main(int argc, char **argv)
}
free(primes);
clock_gettime(CLOCK_MONOTONIC, &end);
elapsed = (end.tv_sec - start.tv_sec) + (double)(end.tv_nsec - start.tv_nsec) / 1000000000;

View File

@ -61,7 +61,7 @@ int main(int argc, char **argv)
printf("Project Euler, Problem 53\n");
printf("Answer: %d\n", count);
printf("Elapsed time: %.9lf seconds\n", elapsed);
return 0;

View File

@ -57,7 +57,7 @@ int main(int argc, char **argv)
printf("Project Euler, Problem 55\n");
printf("Answer: %d\n", count);
printf("Elapsed time: %.9lf seconds\n", elapsed);
return 0;
@ -75,7 +75,7 @@ int is_lychrel(mpz_t n)
for(i = 0; i < 50; i++)
{
mpz_set_ui(reverse, 0);
/* Find the reverse of the given number.*/
while(mpz_cmp_ui(tmp, 0) > 0)
{

View File

@ -43,7 +43,7 @@ int main(int argc, char **argv)
printf("Project Euler, Problem 56\n");
printf("Answer: %d\n", max);
printf("Elapsed time: %.9lf seconds\n", elapsed);
return 0;

View File

@ -56,7 +56,7 @@ int main(int argc, char **argv)
printf("Project Euler, Problem 57\n");
printf("Answer: %d\n", count);
printf("Elapsed time: %.9lf seconds\n", elapsed);
return 0;

View File

@ -55,7 +55,7 @@ int main(int argc, char **argv)
{
count++;
}
i += step;
ratio = (double)count / diag;

BIN
C/p060

Binary file not shown.

View File

@ -13,7 +13,7 @@
#define N 10000
int cat(int i, int j);
int *primes;
int main(int argc, char **argv)
@ -94,7 +94,7 @@ int main(int argc, char **argv)
printf("Project Euler, Problem 60\n");
printf("Answer: %d\n", n);
printf("Elapsed time: %.9lf seconds\n", elapsed);
return 0;