Search found 5 matches

by Sanya
Sat Dec 20, 2003 2:23 am
Forum: Volume 3 (300-399)
Topic: 325 - Identifying Legal Pascal Real Constants
Replies: 63
Views: 15386

Hello, pavelph. One more bug found :lol: Your prog outputs '1e+ is legal.' I suggest you following changes: [pascal] ... if (s[1]='-') or (s[1]='+') then delete(s, 1, 1); if s='' then f:=false else begin f:=true; for n:=1 to length(s) do if not ((s[n]>='0') and (s[n]<='9')) then f:=false; end; ... [...
by Sanya
Fri Dec 19, 2003 6:04 pm
Forum: Volume 3 (300-399)
Topic: 325 - Identifying Legal Pascal Real Constants
Replies: 63
Views: 15386

Try to replace line
[pascal]
if (s[1]='e') or (s[1]='E') then delete(s, 1, 1); f:=true;
[/pascal]
with following:
[pascal]
if (s[1]='e') or (s[1]='E') then begin delete(s, 1, 1); f:=true; end
else begin writeln(i); continue; end;
[/pascal]
by Sanya
Fri Dec 19, 2003 12:54 am
Forum: Volume 3 (300-399)
Topic: 325 - Identifying Legal Pascal Real Constants
Replies: 63
Views: 15386

Hello! I solved this problem. So maybe I can help you, but I need to see your source. Your output seems to be correct.
by Sanya
Tue Dec 16, 2003 3:12 am
Forum: Pascal
Topic: Bugs in pascal compiler ? (problem 348)
Replies: 1
Views: 5720

Bugs in pascal compiler ? (problem 348)

Hello. I don't understand one thing. I've posted Problem 348 in Pascal and C versions. For Pascal ver. reply is Wrong Answer and for C ver. is Accepted :o Is this due to bugs in Free Pascal or have I made some mistakes? [pascal] var t:integer; q:longint; n,i,j,k,l:byte; p:array[0..10] of integer; a:...
by Sanya
Sun Dec 14, 2003 11:41 pm
Forum: Volume 3 (300-399)
Topic: 301 - Transportation
Replies: 13
Views: 4980

Hi, can somebody give me test data for this problem, please. I don't know why my code produces WA. Thank you. [pascal] var n,m,k,i,j,sum,bestsum:integer; c:array[1..22] of integer; r:array[0..6] of integer; a,b,x:array[1..22] of byte; begin while True do begin read(n,m,k); if (n=0)and(m=0)and(k=0) t...

Go to advanced search