Remove unused variables

This commit is contained in:
daniele 2019-10-11 19:02:50 +02:00
parent 4d981520fc
commit 751f80ef47
Signed by: fuxino
GPG Key ID: 6FE25B4A3EE16FDA
6 changed files with 6 additions and 7 deletions

View File

@ -26,7 +26,6 @@
int main(int argc, char **argv)
{
int a, b, n, p, count, max = 0, save_a, save_b;
int *primes;
double elapsed;
struct timespec start, end;

View File

@ -23,7 +23,7 @@ int *primes;
int main(int argc, char **argv)
{
int i, found = 0;
int i;
double elapsed;
struct timespec start, end;

View File

@ -110,7 +110,7 @@ int main(int argc, char **argv)
* the right key was likely found.*/
if(strstr(plain_text, "the") != NULL && strstr(plain_text, "be") != NULL &&
strstr(plain_text, "to") != NULL && strstr(plain_text, "of") != NULL &&
strstr(plain_text, "and") != NULL & strstr(plain_text, "in") != NULL &&
strstr(plain_text, "and") != NULL && strstr(plain_text, "in") != NULL &&
strstr(plain_text, "that") != NULL && strstr(plain_text, "have") != NULL)
{
sum = 0;
@ -122,7 +122,7 @@ int main(int argc, char **argv)
}
found = 1;
printf("%c%c%c\n", c1, c2, c3);
// printf("%c%c%c\n", c1, c2, c3);
}
}
}

View File

@ -16,7 +16,7 @@
int main(int argc, char **argv)
{
int i, n;
int n;
long int *partitions;
double elapsed;
struct timespec start, end;

View File

@ -52,7 +52,7 @@ int main(int argc, char **argv)
elapsed = (end.tv_sec - start.tv_sec) + (double)(end.tv_nsec - start.tv_nsec) / 1000000000;
printf("Project Euler, Problem 206\n");
printf("Answer: %d\n", n);
printf("Answer: %ld\n", n);
printf("Elapsed time: %.9lf seconds\n", elapsed);

View File

@ -316,7 +316,7 @@ void insertion_sort(void **array, int l, int r, int (*cmp)(void *lv, void *rv))
int partition(void **array, int l, int r, int (*cmp)(void *lv, void *rv))
{
int i = l -1, j = r;
void *pivot, *tmp;
void *pivot;
/* Arbitrarily selecting the rightmost element as pivot.*/
pivot = array[r];