-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#define MAX 1000 | ||
|
||
int main(int argc, char const *argv[]){ | ||
|
||
for(int i=1; i<MAX; i++){ | ||
for(int j=1; j<MAX; j++){ | ||
double cont = (1+1+5+i+j)/5; | ||
if(cont == 4){ | ||
printf("Number: %d %d\n", i, j); | ||
printf("Product: %d\n", (j*i*5)); | ||
} | ||
} | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
/* x x x x x | ||
Media = 4 | ||
Moda = 1 | ||
Mediano = 5 | ||
Logo sabemos que o valor do meio é 5, entao: | ||
x x 5 x x | ||
Sabemos tambem que 1 é moda ou seja aparece 2 ou 3 vezes o valor 1 | ||
1 1 5 x x ou 1 1 5 1 x | ||
*/ |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#define MAX 1000 | ||
|
||
int verfy(int x, int arr[]){ | ||
if(arr[x] != 0) | ||
return 0; | ||
else | ||
return 1; | ||
} | ||
|
||
int main(int argc, char const *argv[]){ | ||
|
||
int i,j; | ||
int cont=0; | ||
int arr[MAX+1]; | ||
|
||
for(i=1; i<=MAX; i++){ | ||
arr[i] = 0; | ||
} | ||
|
||
for(i=1; i<=MAX; i++){ | ||
for(j=1; j<=MAX; j++){ | ||
if(i+j == MAX && verfy(i,arr) && verfy(j,arr)){ | ||
arr[i] = arr[j] = 1; | ||
printf("%d + %d = %d\n", i, j, (i+j)); | ||
cont++; | ||
} | ||
} | ||
|
||
} | ||
printf("%d\n", cont); | ||
|
||
return 0; | ||
} |