| 比赛 | 防止颓废的小练习v0.15 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 数字反转 | 最终得分 | 100 |
| 用户昵称 | TenderRun | 运行时间 | 0.002 s |
| 代码语言 | C++ | 内存使用 | 0.31 MiB |
| 提交时间 | 2016-10-17 19:07:39 | ||
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main(){
freopen("reverse.in","r",stdin);
freopen("reverse.out","w",stdout);
int x,y=0,f=1;
scanf("%d",&x);
if(x<0)x=-x,f=-1;
while(x){
y=y*10+x%10;
x=x/10;
}
printf("%d\n",f*y);
return 0;
}