真正的水题!

var
n:string;
i,k:longint;
begin
readln(n);
if n[1]='-' then
begin
write(n[1]);
delete(n,1,1);
end;
k:=length(n);
while n[k]='0' do
begin
delete(n,k,1);
k:=k-1;
end;
for i:=length(n) downto 1 do
write(n[i]);
end.

1 条评论

  • @ 2014-12-24 20:55:55

    var
    a:string;
    b:array[1..255]of integer;
    c,i,s:integer;
    begin
    readln(a);
    if a[1]='-' then
    begin
    write('-');
    c:=2;
    end
    else c:=1;
    s:=length(a);
    for i:=c to s do
    b[i]:=ord(a[i])-48;
    i:=s;
    while b[i]=0 do
    begin
    s:=s-1;
    i:=i-1;
    end;
    for i:=s downto c do write(b[i]);
    end.

    呵呵

  • 1

信息

ID
1756
难度
4
分类
模拟 点击显示
标签
递交数
3911
已通过
1766
通过率
45%
被复制
22
上传者