Var a,b,c,d,e,f,g,x1,x2:real; begin Write('Введите значения e,f,g: '); Readln(e,f,g); a:=sqrt(abs(sqr(e)-g)/3); Writeln('a= ',a:0:5); b:=abs((e-f)/7); b:=b*sqr(b)-cos(g); Writeln('b= ',b:0:5); c:=f*sqr(f)-g/17; Writeln('c= ',c:0:5); d:=sqr(b)-4*a*c; if d<0 then Writeln('Действителных корней нет') else if d=0 then begin x1:=(-b-sqrt(d))/(2*a); x2:=x1; Writeln('x1=x2= ',x1:0:5) end else begin x1:=(-b-sqrt(d))/(2*a); x2:=(-b+sqrt(d))/(2*a); Writeln('x1= ',x1:0:5,', x2= ',x2:0:5) end end.
a,b,c,d,e,f,g,x1,x2:real;
begin
Write('Введите значения e,f,g: '); Readln(e,f,g);
a:=sqrt(abs(sqr(e)-g)/3); Writeln('a= ',a:0:5);
b:=abs((e-f)/7); b:=b*sqr(b)-cos(g); Writeln('b= ',b:0:5);
c:=f*sqr(f)-g/17; Writeln('c= ',c:0:5);
d:=sqr(b)-4*a*c;
if d<0 then Writeln('Действителных корней нет')
else
if d=0 then begin
x1:=(-b-sqrt(d))/(2*a); x2:=x1;
Writeln('x1=x2= ',x1:0:5)
end
else begin
x1:=(-b-sqrt(d))/(2*a); x2:=(-b+sqrt(d))/(2*a);
Writeln('x1= ',x1:0:5,', x2= ',x2:0:5)
end
end.
Тестовое решение:
Введите значения e,f,g: 2 -3 -3
a= 1.52753
b= 1.35442
c= -26.82353
x1= -4.65721, x2= 3.77053
#include <cmath>
using namespace std;
void main()
{
int n,sum=0;
float y,k=0;
cin >> n;
int *mass = new int[n];
for (int i = 0;i < n;++i)
{
cin >> mass[i];
}
for (int i = 0;i < n;++i)
{
if (mass[i] >0 )
{
k++;
y=pow(mass[i],2);
cout<<y;
sum+=mas[i]
}
}
system("pause");
}
2)#include <iostream>
#include <cmath>
using namespace std;
void main()
{
int s,p,r,day=0;
cin >> s>>p>>r;
float km=s;
while(r>km)
{
km+=km*p/100;
day++;
}
cout << " km = " << km << " day = " << day << endl;
system ("pause");
}