Program wz;var a,b:integer;x:real;
begin
writeln('Введите a ');
readln(a);
writeln('Введите b');
readln(b);
x:=(a+b)/(a*b);
writeln('x=',x);
end.
Var
n,b,i,k,r:integer;
begin
readln(n);
for i:=1 to n do
begin
readln(b);
if b>=8 then
begin
k:=k+1;
r:=r+b;
end;
end;
writeln('Количество сдавших:',k);
writeln('Среднее значение:',r/k);
end.
Var i:Integer;s:real;
A:array[1..130]of integer;
Begin
S:=0;
For i:=1 to 130 do begin
A[i]:=random(100);
S:=s+A[i];
End;
S:=s/130;
Write(s);
End.
C++
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if ((a + b + c) == 180 ) {
cout << "These are the angles of the triangle" << endl;
if ((a == 90) || (b == 90) || (c == 90)) {
cout << "Rectangular";
} else {
cout << "Not rectangular";
}
} else {
cout << "These are not the angles of the triangle";
}
return 0;
}
Var a,b:real;
begin
write('a, b: ');
readln(a,b);
writeln(a,' + ',b,' = ',a+b);
if a+b<1
then if a<b then a:=(a+b)/2 else b:=(a+b)/2
else if a<b then a:=a+b else b:=a+b;
writeln('a = ',a,' b = ',b);
end.
Пример:
a, b: -2.8 4.5
-2.8 + 4.5 = 1.7
a = 1.7 b = 4.5