| 记录编号 | 
        188195 | 
        评测结果 | 
        AAAAAAAAAA | 
    
    
        | 题目名称 | 
        623.[NOIP 2011]数字反转 | 
        最终得分 | 
        100 | 
            
    
    
        | 用户昵称 | 
         Satoshi | 
        是否通过 | 
        通过 | 
    
    
        | 代码语言 | 
        C++ | 
        运行时间 | 
        0.003 s  | 
    
    
        | 提交时间 | 
        2015-09-21 22:43:46 | 
        内存使用 | 
        0.31 MiB  | 
        
    
    
    
    		显示代码纯文本
		
		#include <iomanip>
#include <fstream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
using namespace std;
int i=0,j;
char a[1000],ch;
bool flag=true,f1=true;
int main()
{
	ifstream input("reverse.in");
	ofstream output("reverse.out");
				
	
	while((ch=input.get())!=EOF)
	{
		//ch=input.get();
		i++;
		a[i]=ch;
		if(ch=='\n'||ch=='\r')break;
	}
				
	if(a[1]=='-')
	{
		flag=false;
	}
	if(flag)
	{
		for(j=i-1;j>=1;j--)
		{
			//output<<a[j]<<' ';
			if(a[j]!='0'||!f1)
			{
				f1=false;
				output<<a[j];
			}
		}
	}
	else
	{
		output<<a[1];
		for(j=i-1;j>=2;j--)
		{
			if(a[j]!='0'||!f1)
			{
				f1=false;
				output<<a[j];
			}
		}
	}
				
	input.close();
	output.close();
	return 0;
}