|
|
back to boardCan any1 help what is wrong here??? Posted by Swifty 12 Mar 2009 14:02 var s:string; s1:array [1..100] of char; a,b:array [1..100] of integer; i,j,n:integer; begin readln(s); n:=length(s); for i:=1 to n do a[i]:=ord(s[i])-97; for i:=n downto 2 do {24+x-26 = 17} begin b[i]:=(a[i]+26-a[i-1])mod 26; s1[i]:=chr(b[i]+97); end; s1[1]:=chr(((a[1]-5)mod 26)+97); for i:=1 to n do write(s1[i]); readln; end. WA on 4th test!!! Re: Can any1 help what is wrong here??? Posted by Swifty 12 Mar 2009 14:11 lol got AC now.... |
|
|