Pages

Saturday, July 30, 2011

a038. 數字翻轉


#include
using namespace std;

int main() {
string num;
while(cin>>num)
{
int l = num.length();
for(int i=0,flag_meet_value=0;i {
if(flag_meet_value==0 && num[l-1-i]=='0') continue;
else flag_meet_value=1;
if(flag_meet_value==1) cout< }
cout< }
return 0;
}

No comments:

Post a Comment