题解 | kiki算数
#include <stdio.h> #include <string.h> int main() { unsigned int a, b; scanf("%d %d", &a, &b); char res[20]; sprintf(res, "%u", a + b);// 将a+b的结果转换为字符串存储在res中 int length = strlen(res); int sum = (res[length - 2]-'0') * 10 + (res[length - 1]-'0'); printf("%d\n", sum); return 0; }