Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int
- main ()
- {
- FILE * arq;
- arq = fopen ("jogoZerinhoouUm.txt", "w");
- if (arq == NULL)
- {
- printf ("Erro na criaC'C#o do arquivo.\n");
- return 0;
- }
- int n, i, a, b, c;
- char stri[51];
- fscanf (arq, "%d", &n);
- for (i = 0; i < n; i++)
- {
- fscanf (arq, "%d %d %d", &a, &b, &c);
- }
- fscanf (arq, "%s", stri);
- for (i = 0; i < n; i++)
- {
- if (a != (b == c))
- {
- printf ("%d - %d - %d -> %d", a, b, c, a);
- }
- else
- if (b != (a == c))
- {
- printf ("%d - %d - %d -> %d", a, b, c, b);
- }
- else
- if (c != (a == b))
- {
- printf ("%d - %d - %d -> %d", a, b, c, c);
- }
- else
- printf ("%d - %d - %d -> *", a, b, c);
- }
- fclose (arq);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement