Tham khảo:
uses crt;
var a:array[1..5] of integer;
i,t:integer;
tb:real;
begin
for i:=1 to 5 do readln(a[i]);
t:=0;
for i:=1 to 5 do t:=t+a[i];
tb:=t/5;
write(Tb);
readln;
end.
Uses crt;
Var a,b,c,d,e,g:longint;
Begin
Clrscr;
writeln(so thu nhat la);readln(a);
writeln(so thu nhat la);readln(b);
writeln(so thu nhat la);readln(c);
writeln(so thu nhat la);readln(d);
writeln(so thu nhat la);readln(e);
g:=a+b+c+d+e;
Writeln('Tong scua 5 so la',g);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long x,i,t;
int main()
{
t=0;
for (i=1; i<=5; i++)
{
cin>>x;
t=t+x;
}
cout<<t;
return 0;
}
Var a,b,c,d,e,s:integer;
Begin
Write('Nhap so thu nhat ');readln(a);
Write('Nhap so thu hai ');readln(b);
Write('Nhap so thu ba ');readln(c);
Write('Nhap so thu tu ');readln(d);
Write('Nhap so thu nam ');readln(e);
s:=a+b+c+d+e;
Write('Tong la ',s);
Readln;
End.