题解 | #数字翻转#
数字翻转
https://www.nowcoder.com/practice/bc62febdd1034a73a62224affe8bddf2
#include <stdio.h> int rev(int n) { int res = 0; while(n!=0) { res= res*10 + n%10; n = n/10; } return res; } int main() { int x, y; while (scanf("%d %d", &x, &y) != EOF) { int a,b,c; a = rev(x); b = rev(y); c = rev(a+b); printf("%d\n", c); } return 0; }