program coba ;
uses wincrt ;
var
bil1:array[1..100] of integer;
bil2:array[1..100] of integer;
bil3:array[1..100] of integer;
rata :real;
jumlah1 :integer;
jumlah2 :integer;
jumlah3, total :integer;
i,n :integer;
begin
clrscr;
writeln;
write(' jumlah N pertama =');readln(n);
for i:= 1 to n do
begin
write(' Bilangan ke ',i,' = ');readln(bil1[i]);
end;
jumlah1 := n+n;
writeln;
write(' jumlah N kedua =');readln(n);
for i:= 1 to n do
begin
write(' Bilangan ke ',i,' = ');readln(bil2[i]);
end;
jumlah2 := n+n;
writeln;
write(' jumlah N ketiga =');readln(n);
for i:= 1 to n do
begin
write(' Bilangan ke ',i,' = ');readln(bil3[i]);
end;
jumlah3 := n+n;
total := jumlah1+jumlah2+jumlah3;
rata := total div n;
writeln;
write(' jumlah ke 1 ',jumlah1);
writeln;
write(' jumlah ke 2 ',jumlah2);
writeln;
write(' jumlah ke 3 ', jumlah3);
writeln;
write(' total ', total);
writeln;
write(' rata ',rata:2:2) ;
end.
0 Comment:
Posting Komentar