Bài 1:
Var i,so,s:integer;
Begin
For i:=1 to 10 do
Begin
Write('Nhap so thu ',i,' = ');readln(so);
s:=s+so;
End;
Write('Tong la ',s);
Readln
End.
Bài 2:
Var i,n,s,so:integer;
Begin
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap so thu ',i,' = ');readln(so);
s:=s+so;
End;
Write('Tong la ',s);
Readln
End.
Bài 3:
Var a:array[1..15] of real;
i:integer;
Begin
For i:=1 to 5 do
Begin
Write('Nhap so thu ',i,' = ');readln(a[i]);
End;
Readln
End.
Bài 4:
Var a:array[1..10] of real;
i:integer;
s:real;
Begin
For i:=1 to 10 do
Write('Nhap chieu cao hs thu ',i,' = ');readln(a[i]);
s:=s+a[i];
End;
Write('Tong chieu cao la ',s:10:2);
Readln
End.
Bài 5:
Var b:array:[1..1000] of integer;
i,n,max:integer;
s:longint;
tb:real;
Begin
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap so thu ',i,' = ');readln(b[i]);
s:=s+b[i];
End;
max:=b[1];
tb:=s/n;
For i:=2 to n do
If b[i] > max then max:=b[i];
Writeln('Tong la ',s);
Writeln('Trung binh la ',tb:10:2);
write('So lon nhat la ',max);
Readln
End.