|
|
back to boardLet's shut "No" to arrays and strings! I use only 3 variables and got accepted. Here is my solution: var k,l:char; procedure use; var c:char; begin read(c); if (c in ['a'..'z'])or(c in ['A'..'Z'])or(c=#45) then begin use; if c<>#45 then write(c); end else l:=c; end; begin while not eof do begin while (not eoln)and(not eof) do begin read(k); if (k in ['a'..'z'])or(k in ['A'..'Z']) then begin use; if k<>#45 then write(k); write(l); end else write(k); end; readln; writeln; end; end. Re: Let's shut "No" to arrays and strings! I use only 3 variables and got accepted. Here is my solution: > var > k,l:char; > procedure use; > var > c:char; > begin > read(c); > if (c in ['a'..'z'])or(c in ['A'..'Z'])or(c=#45) then > begin > use; > if c<>#45 then write(c); > end else l:=c; > end; > begin > while not eof do > begin > while (not eoln)and(not eof) do > begin > read(k); > if (k in ['a'..'z'])or(k in ['A'..'Z']) then > begin > use; > if k<>#45 then write(k); > write(l); > end else write(k); > end; > readln; > writeln; > end; > end. u AC? WA! Re: Let's shut "No" to arrays and strings! I use only 3 variables and got accepted. Here is my solution: I got an Accept and then was rejudged to a Wrong Answer. I don't know where is a bug. If you will find it tell me please. Re: Let's shut "No" to arrays and strings! I use only 3 variables and got accepted. Here is my solution: Posted by JL Wang 10 Nov 2002 16:49 > I got an Accept and then was rejudged to a Wrong Answer. > I don't know where is a bug. If you will find it tell me please. There was an BUG in judge system when you first judge it, because the test data was not ready then. And that means your solution was wrong, I'm afraid. |
|
|