|
|
back to boardwhy i have WA#1 Posted by alexdeg 11 Mar 2013 20:30 var fi,fv:text; chi,kolc: longint; procedure round_sqrt(a:longint; var kol:longint); var b:longint; begin b:=trunc(sqrt(a)); b:=b*b; a:= a-b; if a> 0 then begin kol:=kol+1; round_sqrt(a,kol); end else kol:=kol+1; end; begin assign(fi,'input.txt'); reset(fi); assign(fv,'output.txt'); rewrite(fv); {============} read(fi,chi); kolc:=0; if chi>0 then round_sqrt(chi,kolc); write(fv,kolc); {============} close(fi); close(fv); end. Re: why i have WA#1 Don't use files. Only standart streams. |
|
|