1) var a,b,c,d,e,f,r,x,y,z:real; begin writeln('d, e, f:'); readln(d,e,f); write('r = '); readln(r); x:=d*pi/180; y:=e*pi/180; z:=f*pi/180; a:=2*r*sin(x); b:=2*r*sin(y); c:=2*r*sin(z); writeln('a = ',a:5:2,' b = ',b:5:2,' c = ',c:5:2); end.
Пример: d, e, f: 90 60 30 r = 2.5 a = 5.00 b = 4.33 c = 2.50
2) var a,b,c,d:integer; begin writeln('a, b, c, d:'); readln(a,b,c,d); if a+c>150 then writeln('a+c = ',a+c,' a = ',a,' b = ',b,' c = ',c,' d = ',d); end.
Пример: a, b, c, d: 72 18 94 25 a+c = 166 a = 72 b = 18 c = 94 d = 25
Код программы:
#include <iostream>
using namespace std;
int main()
{
int a, b ,c;
cout<<"Введите 3 целых числа"<<endl;
cin >>a>>b>>c;
cout<<a<<"+"<<b<<"+"<<c<<"="<<a+b+c<<endl;
cout<<a<<"*"<<b<<"*"<<c<<"="<<a*b*c<<endl;
cout.precision(4);
cout<<"("<<a<<"+"<<b<<"+"<<c<<")/3"<<"="<<(a+b+c)/3.<<endl;
return 0;
}
var a,b,c,d,e,f,r,x,y,z:real;
begin
writeln('d, e, f:');
readln(d,e,f);
write('r = ');
readln(r);
x:=d*pi/180;
y:=e*pi/180;
z:=f*pi/180;
a:=2*r*sin(x);
b:=2*r*sin(y);
c:=2*r*sin(z);
writeln('a = ',a:5:2,' b = ',b:5:2,' c = ',c:5:2);
end.
Пример:
d, e, f:
90 60 30
r = 2.5
a = 5.00 b = 4.33 c = 2.50
2)
var a,b,c,d:integer;
begin
writeln('a, b, c, d:');
readln(a,b,c,d);
if a+c>150
then writeln('a+c = ',a+c,' a = ',a,' b = ',b,' c = ',c,' d = ',d);
end.
Пример:
a, b, c, d:
72 18 94 25
a+c = 166 a = 72 b = 18 c = 94 d = 25