【NOIP2011普及组真题】数字反转
2018-03-29 17:06
381 查看
水题。#include<iostream>
#include<cstring>
#pragma G++ optamize (2)
using namespace std;
char a[2000];
char b[2000];
int main(){
//-16
// freopen("reverse.in","r",stdin);
// freopen("reverse.out","w",stdout);
cin>>a;
int lenth=strlen(a);
while(a[lenth-1]=='0'&&lenth!=0){
lenth--;
}
for(int i=0;i<lenth;i++){
b[lenth-i-1]=a[i];
}
if(a[0]=='-')
cout<<"-";
if(b[lenth-1]=='-')
lenth--;
for(int i=0;i<lenth;i++){
cout<<b[i];
}
return 0;
}
相关文章推荐
- NOIP 2011 普及组 复赛 reverse 数字反转
- 【模拟】[NOIP2011普及组]数字反转
- noip2011普及组——数字反转
- [0608] Noip2011 普及组 Problem 1数字反转
- luogu1307 数字反转(NOIP2011普及组第1题)
- 【模拟】[NOIP2011普及组]数字反转
- noip2011普及组复赛——数字反转
- NOIP2011-普及组复赛-第一题-数字反转
- NOIP2011复赛普级组&nbsp;数字反转
- NOIP2011复赛普级组&nbsp;数字反转
- 【NOIP2013普及组真题】小朋友的数字
- 【NOIP2011普及组真题】瑞士轮
- noip2011数字反转
- 数字反转 2011年NOIP全国联赛普及组
- noip2011 数字反转 (模拟)
- [Noip2010普及组]数字统计
- NOIP2011普及组:瑞士轮
- NOIP 2011 普及组 复赛 stat 统计单词数
- 【2011noip普及组】瑞士轮解题报告
- Noip2011普及组