why?????只有20分

P1307 [NOIP2011 普及组] 数字反转

xyf0513 @ 2017-08-07 20:34:09

#include<stdio.h>
int main()
{
    int a,b,c,n,m;
    scanf("%d",&n);
    if(n%10==0)
    a=n/100;b=(n/10)%10;c=n%10;
    m=10*b+a;
    if(n%10!=0)
    a=n/100;b=(n/10)%10;c=n%10;
    m=100*c+10*b+a;
    printf("%d",m);
}

by xyf0513 @ 2017-08-07 20:37:07

哦哦明白了,题目里没说一定是三位数


|