字符串不行?为什么0分?

P1307 [NOIP2011 普及组] 数字反转

MiaoZ @ 2017-07-06 13:25:14

···

var
  s:string[15];  i:longint;
begin
  readln(s);
  if s[1]='-' then 
   begin
    write('-');
    delete(s,1,1);
   end;
  if s[length(s)]<>'0' then write(s[length(s)]);
  for i:=length(s)-1 to 1 do write(s[i]);
end.  
···

by MiaoZ @ 2017-07-06 13:29:12

已找到错误,谢谢大家了。


|