|
|
вернуться в форумLOL Послано Rest0 15 ноя 2013 19:04 #include "stdafx.h" #include "stdio.h" #include "locale.h" int main() { setlocale(LC_CTYPE, "rus"); int X, Z;
char Y; printf("Введите координаты клетки коня: "); scanf("%c%d", &Y, &Z); switch (Y) { case 'a': Y = 1; break; case 'b': Y = 2; break; case 'c': Y = 3; break; case 'd': Y = 4; break; case 'e': Y = 5; break; case 'f': Y = 6; break; case 'g': Y = 7; break; case 'h': Y = 8; break; default: break; }
if (Y == 1 && Z == 1 || Y == 1 && Z == 8 || Y == 8 && Z == 1 || Y == 8 && Z == 8) { printf("Клеток под боем: 2\n"); } else { if (Y == 1 && Z == 2 || Y == 1 && Z == 7 || Y == 2 && Z == 1 || Y == 2 && Z == 8 || Y == 7 && Z == 1 || Y == 7 && Z == 8 || Y == 8 && Z == 2 || Y == 8 && Z == 7) { printf("Клеток под боем: 3\n"); } else { if (Y == 1 && Z == 3 || Y == 1 && Z == 4 || Y == 1 && Z == 5 || Y == 1 && Z == 6 || Y == 8 && Z == 3 || Y == 8 && Z == 4 || Y == 8 && Z == 5 || Y == 8 && Z == 6 || Z == 1 && Y == 3 || Z == 1 && Y == 4 || Z == 1 && Y == 5 || Z == 1 && Y == 6 || Z == 8 && Y == 3 || Z == 8 && Y == 4 || Z == 8 && Y == 5 || Z == 8 && Y == 6 || Y == 2 && Z == 2 || Y == 2 && Z == 7 || Y == 7 && Z == 2 || Y == 7 && Z == 7) { printf("Клеток под боем: 4\n"); } else { if (Y == 2 && Z == 3 || Y == 2 && Z == 4 || Y == 2 && Z == 5 || Y == 2 && Z == 6 || Y == 7 && Z == 3 || Y == 7 && Z == 4 || Y == 7 && Z == 5 || Y == 7 && Z == 6 || Z == 2 && Y == 3 || Z == 2 && Y == 4 || Z == 2 && Y == 5 || Z == 2 && Y == 6 || Z == 7 && Y == 3 || Z == 7 && Y == 4 || Z == 7 && Y == 5 || Z == 7 && Y == 6) { printf("Клеток под боем: 6\n"); } else { if (Y == 3 && Z == 3 || Y == 3 && Z == 4 || Y == 3 && Z == 5 || Y == 3 && Z == 6 || Y == 4 && Z == 3 || Y == 4 && Z == 4 || Y == 4 && Z == 5 || Y == 4 && Z == 6 || Y == 5 && Z == 3 || Y == 5 && Z == 4 || Y == 5 && Z == 5 || Y == 5 && Z == 6 || Y == 6 && Z == 3 || Y == 6 && Z == 4 || Y == 6 && Z == 5 || Y == 6 && Z == 6) { printf("Клеток под боем: 8\n"); } else { printf("Где конь, парень? 0_о \n"); } } } } } return 0;
} what's wrong, guys? :D P.S.: WA 1 Re: LOL Hi, you shouldn't print out anything else than the requested number. Please remove the messages in russian from the printf. Re: LOL HAHA made my day :D:D:D Re: LOL Где конь, парень? 0_о WOW! :D |
|
|