第2个回答 2013-10-19
#include<iostream.h>
void main()
{int x,y,a,b,c;<br> cout<<"请输入一个三位数:";<br> cin>>x;<br> if ((x<100)||(x>999))<br> {<br> cout<<"error!";<br> }
c=x%10;
b=x%100;
b=b/10;
a=x/100;
y=100*c+10*b+a;
if(c!=0)
{
cout<<"反向输出结果为:"<<y<<endl;
}
else
{
cout<<"反向输出结果为:"<<"0"<<y<<endl;
}
}