
// adaptado de Barton,Nackman "Scientific and Engineering C++"
//      jtmn, Ago, 2003


#include <iostream>
using namespace std;
int main() {
    // Read the coefficients of a line equation in the form ax+by+c = 0,
    // then print the line's x- and y-intercepts.

    // Read the equation coefficients.
    float a, b, c;
    cout << " de os coef. da reta ax+by+c = 0 " << endl;
    cin >> a >> b >> c;

    // Print the equation coefficients.
    cout << "Coefficients: " << a << ", " << b << ", " << c << endl;

    // Compute and print the x-intercept.
    cout << "x-intercept: ";
    if (a != 0) {
        cout << -c / a << ", ";
    } 
    else {
        cout << "none, ";
    }


    // Compute and print the y-intercept.
    cout << "y-intercept: ";
    if (b != 0) {
        cout << -c / b << endl;
    } 
    else {
        cout << "none" << endl;
    }

    return 0;
} 

