Методика програмирања

  • Published on
    02-Jan-2016

  • View
    23

  • Download
    1

Embed Size (px)

DESCRIPTION

. - o . : : . 480/08. . ? ? PASCAL- ?. . - PowerPoint PPT Presentation

Transcript

The Chalkboard

- o 480/08: : ? ? PASCAL-? ...

; ( ); , ; : nxmn m (n m )

/ ? c[i,j]i - , - ; 3x3?

, (i=j); i+j = n+1; ?

(n=m); PASCAL-...K type:

var: PASCAL-typeNiz=array[1..15] of real;Matrica=array[1..20] of Niz;varA:Matrica;

varA:array [1..20, 1..15] of real;

Jo? , .

1:program SumaPozitivnih;type Matrica=array[1..20, 1..15] of real;var A:Matrica; n,m,i,j:integer; S:real;begin write(Unesi dimenzije matrice: ); readln(n,m); writeln(Ucitaj vrednosti elemenata matrice: ); for i:=1 to n dofor j:=1 to m doread(A[i,j]); S:=0; for i:=1 to n dofor j:=1 to m doif A[i,j]>0 then S=S+A[i,j]; Writeln(S=, S:10:2);end.

, .

2:

2:program xDijagonala;type Matrica=array[1..20, 1..20] of integer;varA:Matrica;n,,i,j:integer;max:integer;beginwrite(Unesi dimenziju matrice: );readln(n);writeln(Ucitaj vrednosti elemenata matrice: );for i:=1 to n dofor j:=1 to m doread(A[i,j]);max:=A[i,j];

2:for i:=1 to n dofor j:=1 to m doif i=j thenif A[i,j]>max then max=A[i,j];Writeln(max=, max);end.

? !

:http://milicamaletkovic.wordpress.com/