感觉还有优化的余地. #include<stdio.h> int main() { int a,b,c; scanf("%d %d",&a,&b); c=a+b; if(c<100) printf("%d",c); else { int n = c/10%10; int x = c%10; printf("%d",n*10+x); } return 0; }