Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main(void)
- {
- int i, linhaCavalo, c = 0, contMov, aux;
- char colunaCavalo;
- char Peoes[8][10];
- scanf("%d", &linhaCavalo);
- while(linhaCavalo > 0)
- {
- scanf(" %c", &colunaCavalo);
- c++;
- getchar();
- for(i = 0; i < 8; i++)
- {
- gets(Peoes[i]);
- printf("%s\n", Peoes[i]);
- }
- contMov = 0;
- if(linhaCavalo <= 6)
- {
- if(colunaCavalo >= 'b')
- {
- aux = 0;
- for(i = 0; i < 8 && aux == 0; i++)
- if(( (Peoes[i][0] - 48) > 1 && Peoes[i][1] + 1 ==) || (Peoes[i][0] - 48 > 1))
- aux = 1;
- if(aux == 0)
- contMov++;
- }
- }
- printf("Caso de teste #%d: %d movimento(s).\n", c, contMov);
- scanf("%d", &linhaCavalo);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement