|
|
вернуться в форумfor anyone who wants to solve this problem: Послано Koala 10 сен 2003 07:51 Maybe the format of input is not: number_number. ("_"represent a space) So please read it one character by another. And i'll share you the procedure of reading datas. Послано Koala 10 сен 2003 07:53 readln(n); fillchar(a,sizeof(a),0); fillchar(b,sizeof(b),0); while true do begin read(ch); while ch=' ' do read(ch); if ch='B' then begin readln; break; end; x:=0; while ch<>' ' do begin x:=x*10+ord(ch)-ord('0'); read(ch); end; readln(y); insert(a[x],y); insert(b[y],x); end; Re: And i'll share you the procedure of reading datas. Maybe you are right ! I change my reading procedure (not like you) and I got AC Thank you!I got AC. Послано Y.Y.M. 14 июн 2004 19:40 At first,I used String to read data. But I WA on text#1. Finally,I realized that the input formal is like this: number_number_.There may be some '_' after the second number. I improve my program and got AC. That's right. The second line in sample input #2 has a space at the end of line. But(+) But you don't need to read character by character. You read a string, then delete all the spaces at its end, and you'll get AC. |
|
|