Declaratia tipurilor de date tablou:
Type <NumeTip>=Array[TipLinie,TipColoana] Of TipElemente;
TipLinie,TipColoana-tipuri ordinale de date; TipElemente-oricare.
Exemplu:
Rezolvare:
Uses CRT;
Type T=Array[1..50,1..10] of Integer;
Var A:T; N,M,I,J:Integer;
Function Sum(I:Integer):Integer;
Var S:Integer;
Begin S:=0;
For J:=1 To M Do S:=S+A[I,J];
Sum:=S
End;
Procedure Citire(Var N,M:Integer; Var A:T);
Var F:Text;
Begin Assign(F,'date.in'); Reset(F);
ReadLn(F,N,M);
For I:=1 To N Do
For J:=1 To M Do Read(F,A[I,J]); Close(F)
End;
Procedure Scrie(N,M:Integer; A:T);
Var F:Text;
Begin Assign(F,'date.out'); Rewrite(F);
For I:=1 To N Do Write(F,Sum(I),' '); Close(F)
End;
Begin Citire(N,M,A);
Scrie(N,M,A)
End.
Sarcini pentru rezolvare:
Problemele rezolvate le transmiteti la adresa: toloaca.svetlana@gmail.com pina la data de 30.04.2020.
Succese!!!
Niciun comentariu:
Trimiteți un comentariu