1 solutions
-
0
C++ :
#include<stdio.h> int main() { int a,b,c,d,e,f,g; scanf("%d",&a); b=a/10000; c=a/1000%10; d=a/100%10; e=a/10%10; f=a%10; g=f*10000+e*1000+d*100+c*10+b; printf("%d",g); return 0; }Pascal :
var s:string; v,flag:int64; c,i,len:longint; begin read(s); val(s,v,c); if (v=0) then write(0) else if ((v<0) and (s[length(s)]='0')) then delete(s,length(s),1) else if ((v>0) and (s[length(s)]='0')) then delete(s,length(s),1); len:=length(s)+1; repeat if s[len]='0' then delete(s,len,1); dec(len); until s[len]<>'0'; if (v<0) then begin delete(s,1,1); flag:=1; end; if flag=1 then write('-'); for i:=length(s) downto 1 do write(s[i]); end.
- 1
Information
- ID
- 16789
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By