[ atlas @ 03.01.2006. 21:10 ] @
NZS i NZD za n brojeva Code: PROGRAM NZD_NZS (INPUT,OUTPUT); USES CRT; label 1,2,3; VAR x:ARRAY[1..9] OF LONGINT; n,i,max,min,a,b:longint; BEGIN clrscr; WRITELN('KOLKO BROJEVA'); READ(N); MAX:=1; for i:=1 to n DO BEGIN WRITELN('UNESI ',I,'. BROJ'); READ(X[I]); IF MAX<X[I] then max:=x[i]; end;min:=x[1]; for i:=2 to n do begin if x[i]<min then min:=x[i]; end; 1: a:=0; for i:=1 to n do begin if max mod x[i]<>0 then a:=a+1; end; if a>0 then max:=max+1;goto 1; if a=0 then goto 2; 2: b:=0; for i:=1 to n do begin if x[i] mod min<>0 then b:=b+1; end; if b>0 then min:=min-1; goto 2; if b=0 then goto 3; 3: writeln; WRITELN('NZS=',MAX); WRITELN('NZD=',MIN); END. nako pokretanja zablokira mi dos......... [Ovu poruku je menjao atlas dana 03.01.2006. u 22:13 GMT+1] |