Jump to content

[PASCAL] Suma tuturor elementelor dintr-un sir


Leventhe
 Share

Recommended Posts


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

 

var x:sir;

i,n,s:integer;

 

begin

s:=0;

 

for i:=1 to n do begin

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

readln(x)

end;

 

for i:=1 to n do

s:=s+x;

 

write(s);

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.