Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
pascal的注意了,每行读完了要readln,不然就WAvar a,b:array[0..10000] of longint; n,i,t:longint; f:boolean; begin while not eof do begin read(n); for i:=1 to n do read(a[i]); readln; fillchar(b,sizeof(b),0); f:=true; for i:=2 to n do begin t:=abs(a[i]-a[i-1]); if (t>=n)or(t=0)or(b[t]=1) then begin f:=false; break; end; b[t]:=1; end; if f then writeln('Jolly') else writeln('Not jolly'); end; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator