Napisz program w C++ który rozwiązuje równanie funkcji liniowej ax+b=0
#include <iostream>using namespace std;int main(){ long double a, b; cin >> a >> b; if (a == 0 && b == 0) cout << "infinite amount of solutions"; else if (a == 0 && b != 0) cout << "no solutions"; else cout << -b/a;}
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
#include <iostream>
using namespace std;
int main()
{
long double a, b;
cin >> a >> b;
if (a == 0 && b == 0)
cout << "infinite amount of solutions"; else
if (a == 0 && b != 0)
cout << "no solutions"; else
cout << -b/a;
}