2022 sector d0
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
3
|
||||
5
|
||||
-7
|
||||
23
|
||||
@@ -0,0 +1 @@
|
||||
21
|
||||
@@ -0,0 +1,22 @@
|
||||
Program Suma;
|
||||
var n, i, S : integer;
|
||||
A : array[1..100] of integer;
|
||||
Intrare, Iesire : text;
|
||||
begin
|
||||
{ Citirea datelor de intrare }
|
||||
assign(Intrare, 'suma.in');
|
||||
reset(Intrare);
|
||||
readln(Intrare, n);
|
||||
for i:=1 to n do
|
||||
readln(Intrare, A[i]);
|
||||
close(Intrare);
|
||||
{ Calcularea sumei }
|
||||
S:=0;
|
||||
for i:=1 to n do
|
||||
S:=S+A[i];
|
||||
{ Scrierea datelor de iesire }
|
||||
assign(Iesire, 'suma.out');
|
||||
rewrite(Iesire);
|
||||
writeln(Iesire, S);
|
||||
close(Iesire);
|
||||
end.
|
||||
@@ -0,0 +1,3 @@
|
||||
1
|
||||
100
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
100
|
||||
@@ -0,0 +1,3 @@
|
||||
2
|
||||
100
|
||||
100
|
||||
@@ -0,0 +1 @@
|
||||
200
|
||||
@@ -0,0 +1,3 @@
|
||||
2
|
||||
100
|
||||
-100
|
||||
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1,11 @@
|
||||
10
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
@@ -0,0 +1 @@
|
||||
55
|
||||
@@ -0,0 +1,11 @@
|
||||
10
|
||||
-1
|
||||
-2
|
||||
-3
|
||||
-4
|
||||
-5
|
||||
-6
|
||||
-7
|
||||
-8
|
||||
-9
|
||||
10
|
||||
@@ -0,0 +1 @@
|
||||
-35
|
||||
Reference in New Issue
Block a user