Jump to content
Hostul a fost schimbat. Daca vedeti serverul offline readaugati rpg.b-zone.ro sau 141.95.124.78:7777 in clientul de sa-mp ×

[PASCAL] Afișarea suma vectorilor (tablou unidimensional)


TheVirus
 Share

Recommended Posts

Descriere: Se dă de la tastatură dimenisiunea și elementele numerelor întregi ale unui vector. Să se afișeze suma vectorilor.
Alte precizari: Acest tip de exercitiu este unul de introducere.

Conținutul programului:

 

uses: crt;

type sir=array [1..100] of integer;

var v:sir;

n,i,s:byte;

begin

clrscr;

write('n= ');

readln(n);

s:=0;

for i:=1 to n do

begin

write('v[',i,']= ');

readln(v);

end;

for i:=1 to n do

s:=s+v;

write('Suma este:', s);

readln

end.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.