Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     int a, b;
  5.     double nghiem;
  6.     cout << "nhap a=";
  7.     cin >> a;
  8.     cout << "nhap b=";
  9.     cin >> b;
  10.     if (a == 0) {
  11.         if (b == 0) {
  12.             cout << "phuong trinh co vo so nghiem";
  13.         }
  14.         else {
  15.             cout << "phuong trinh vo nghiem";
  16.         }
  17.     }
  18.     else {
  19.         nghiem = (double)-b / a;
  20.         cout << "phuong trinh co nghiem la" << nghiem;
  21.     }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement