题解 | #kiki算数#
kiki算数
https://www.nowcoder.com/practice/bcaf710fb58a44e1b678a890e6e90d7c
#include <stdio.h> int main() { long a = 0; long b = 0; scanf("%ld%ld", &a, &b); int sum = a + b; int ret = 0; int ret1 = 0; //一百以内 while (sum) { if (sum < 100) { ret1 = sum % 10; ret = ret + (sum / 10) * 10; } else { break; } sum /= 100; } //一百以外 int count = 0; while (sum) { if (sum >= 100) { count++; if (count < 2) { ret1 = sum % 10; ret = ret + (sum / 10) % 10 * 10; } } sum /= 10; } printf("%d", ret+ret1); return 0; }