//#include <cstdio> // to compile as C++ #include <stdio.h> int rev(int num) { int res = 0; while(num > 0) { res = res*10 + num%10; num /= 10; } return res; } int main() { int cases, x, y; scanf("%d", &cases); while(cases--) { scanf("%d %d", &x, &y); printf("%d\n", rev(rev(x)+rev(y))); } return 0; }
No comments:
Post a Comment