Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char** argv) {
- float a,b;
- float x;
- cout<<"podaj a"<<endl;
- cin>>a;
- cout<<"podaj b"<<endl;
- cin>>b;
- cout<<a<<"x+"<<b<<"=0"<<endl;
- if (a!=0)
- {x=-b/a;
- cout<<"x="<<x<<endl;
- }else
- if (b!=0)
- cout<<"rownanie sprzeczne"<<endl;
- else
- cout<<"rownanie ma nieskonczenie wiele rozwiazan"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement