求助

P1307 [NOIP2011 普及组] 数字反转

风待葬丶 @ 2017-07-21 16:18:35

#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
//#include<windows.h>
using namespace std;
int main()
{int a,b,i=i,sum=0;
cin>>a;
b=a;
if(a==0)
cout<<a;
while(a>0)
{if(a%10!=0)
b=1;
if(b=1)
break;
a/=10;
}
while(a!=0)
{
cout<<a%10;
a/=10;
}
/*while(a<0)
{
if(a==b)
{cout<<"-";
a=-1*a;
}
while(a>0)
{
if(a%10!=0)
cout<<a%10;
a/=10;}
}*/
//cout<<sum;
}

|