|
|
back to boardwhat they programme only use 60k memory with c++ ? Posted by Aply 25 Jul 2005 18:27 who know please tell me ? give me a sample programme is the best! Re: what they programme only use 60k memory with c++ ? var a:array[1..1000]of longint; n,i,j:longint; function nod(k,l:longint):longint; begin repeat if k<l then l:=l mod k else k:=k mod l; until (k=0)or(l=0); nod:=k+l; end; begin read(n); for i:=1 to n do read(a[i]); for i:=n-1 downto 1 do a[i]:=nod(a[i],a[i+1]); write(a[1]); end. |
|
|