Составить программу для решения этой формулы (Паскаль)
Answers & Comments
qonqerer
Var x,a,b,c,p:integer; ans:real; begin read(x,a,b,c,p); ans:=cos(x)+a/(b+c/p); writeln(ans); end.
2 votes Thanks 1
zogofa17
Var x,a,b,c,p,t : Real; begin write('cos(X) + a/(b+c/p'); writeln; write('vvedite x '); read(x); write('vvedite a '); read (a); write('vvedite b '); read(b); write('vvedite c '); read(c); write('vvedite p '); read (p); if p = 0 then begin writeln('p ne o,poprobyi snova'); read(p); end; t:=b+p/c; if t = 0 thenbegin write('vashe sifri plohii,poprobyite snova,vvedite b '); read(b); write('vvedite c '); read(c); write('vvedite p '); if p <> 0 then begin writeln('p ne o,poprobyi snova'); read(p); end;end; t:=cos(x)+a/t; writeln(t); end.
Answers & Comments
ans:real;
begin
read(x,a,b,c,p);
ans:=cos(x)+a/(b+c/p);
writeln(ans);
end.
begin write('cos(X) + a/(b+c/p'); writeln; write('vvedite x '); read(x); write('vvedite a '); read (a); write('vvedite b '); read(b); write('vvedite c '); read(c); write('vvedite p '); read (p); if p = 0 then begin writeln('p ne o,poprobyi snova'); read(p); end; t:=b+p/c; if t = 0 thenbegin write('vashe sifri plohii,poprobyite snova,vvedite b '); read(b); write('vvedite c '); read(c); write('vvedite p '); if p <> 0 then begin writeln('p ne o,poprobyi snova'); read(p); end;end; t:=cos(x)+a/t; writeln(t);
end.