很迷的WA

P1307 [NOIP2011 普及组] 数字反转

Bunnie0116 @ 2017-07-20 15:38:58

#include<cstdio>
#include<string>
#include<iostream>
 int main()
 {
 int m=1,i;
 long s;
 scanf("%d",&s);
 if (s<0){printf("-");s=0-s;}
 while(s>0)
 {
     if(s%10==0){printf("%d",s%10);
     s=s/10;}
    else{
    printf("%d",s%10);
     s=s/10;}
 }
 return 0;
}

|