#include <cstdio>
int main()
{
char mode[32];
scanf("%s", mode);
if (mode[0] == 'A')
{
int a, b;
scanf("%d %d", &a, &b);
a--; b--;
if(a + b == 999)
{
a += 7;
a %= 1000;
b += 1000 - 7;
b %= 1000;
}
printf("%d %d", 1 + 999 - a, 1 + 999 - b);
fflush(stdout);
}
else
{
int c, d;
scanf("%d %d", &c, &d);
c= 999-c+1; d = 999 - d + 1;
if (c + d == 999)
{
d += 7;
d %= 1000;
c += 1000 - 7;
c %= 1000;
}
printf("%d %d", c+1, d+1 );
fflush(stdout);
}
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #include <cstdio> int main() { char mode[32]; scanf("%s", mode); if (mode[0] == 'A') { int a, b; scanf("%d %d", &a, &b); a--; b--; if(a + b == 999) { a += 7; a %= 1000; b += 1000 - 7; b %= 1000; } printf("%d %d", 1 + 999 - a, 1 + 999 - b); fflush(stdout); } else { int c, d; scanf("%d %d", &c, &d); c= 999-c+1; d = 999 - d + 1; if (c + d == 999) { d += 7; d %= 1000; c += 1000 - 7; c %= 1000; } printf("%d %d", c+1, d+1 ); fflush(stdout); } return 0; } |
English