Kod: Zaznacz cały
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main()
{
int a, b;
double x0,x1,x2;
cout <<"Obliczanie pierwiastka funkcji y=ax+b - metoda siecznych z dokladnoscia e."<<endl;
cout<<"Podaj wspolczynniki a i b"<<endl;
cout<<"a= ";
cin>>a;
cout<<"b= ";
cin>>b;
if (b==0)
{
cout<<"Twoje rownanie to: y="<<a<<"x"<<endl;
}
if (b>0)
{
cout<<"Twoje rownanie to: y="<<a<<"x+"<<b<<endl;
}
if (b<0)
{
cout<<"Twoje rownanie to: y="<<a<<"x"<<b<<endl;
}
if (a==0)
{
cout<<"Twoje równanie to y=0"<<endl;
return 0;
}
cout<<"Podaj punkty poczatkowe <x1,x2>"<<endl;
cout <<"x1 = ";
cin >> x1;
cout << "x2 = ";
cin >> x2;
return 0;
}