Description
求一整数的绝对值。(该整数不超过30位)
Input
输入数据有多组,每组占一行,每行包含一个整数。
Output
对于每组输入数据,输出它的绝对值,要求每组数据输出一行。
Sample Input 
123
Sample Output
123
HINT
注意数值会比较大,建议用字符串处理
Source
Code
#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
char str[100];
while(gets(str)!=NULL)
{
if(str[0]=='-')
{
for(int i=1;str[i]!='\0';i++)
cout<<str[i];
cout<<endl;
}
else
cout<<str<<endl;
}
}