Решите информатику. : написать программу, в которой описать массив из 5 целых чисел, ввести элементы массива с клавиатуры, вычислить сумму всех элементов массива и вывести её на экран.
WriteLn('Введите три числа'); ReadLn(A,B,C); if (A<=B)and(B<=C) then Write(A,' ',B,' ',C) else if (A<=C)and(C<=B) then Write(A,' ',C,' ',B) else if (B<=A)and(A<=C) then Write(B,' ',A,' ',C) else if (B<=C)and(C<=A) then Write(B,' ',C,' ',A) else if (C<=A)and(A<=B) then Write(C,' ',A,' ',B) else if (C<=B)and(B<=A) then Write(C,' ',B,' ',A) End.
Var a,b,c,D:real; Begin Write('a = ');ReadLn(a); Write('b = ');ReadLn(b); Write('c = ');ReadLn(c); D:=b*b-4*a*c; if D>=0 then Begin WriteLn('x = ',(-b-sqrt(D))/(2*a)); WriteLn('x = ',(-b+sqrt(D))/(2*a)); End else WriteLn('Действительных корней нет') End.
var a,b,c,d,x,x1,x2:real; begin write ('a='); read (a); write ('b='); read (b); write ('c='); read (c); d:=b*b-4*a*c; if d<0 then writeln ('NO') else if d>0 then begin x1:=(-b+sqrt(d))/(2*a); x2:=(-b-sqrt(d))/(2*a); writeln ('x1=',x1:0:2,' x2=',x2:0:2) end else begin x:=-b/(2*a); writeln ('x=',x); end end.
var
ar: array[1..5]of integer;
i, sum: integer;
begin
sum := 0;
for i := 1 to 5 do
begin
read(ar[i]);
sum := sum + ar[i];
end;
write(sum);
end.