Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  прок
Language: PASCAL
Code:
uses Crt;
const n=10;
var  a, i, Sum: integer;
     Sred: real;
begin
ClrScr;
Sum:=0;
i:=1;
While i<=10 do
 begin
   Write ('a = ');
   ReadLn(a);
   Sum:=Sum+a;
   i:=i+1;
 end;
 Sred:=Sum/n;
 Writeln('Sred = ', Sred:6:2);
 WriteLn;

Sum:=0;
i:=1;
repeat
   Write ('a = ');
   ReadLn(a);
   Sum:=Sum+a;
   i:=i+1;
 until i>n;
 Sred:=Sum/n;
 Writeln('Sred = ', Sred:6:2);
 WriteLn;

Sum:=0;
for i:=1 to n do
  begin
      Write ('a = ');
      ReadLn(a);
      Sum:=Sum+a;
  end;
 Sred:=Sum/n;
 Writeln('Sred = ', Sred:6:2);
 ReadLn;
 end.
     
Comments: