fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. float k, c; float x, y;
  6. cin >> k >> c; x = 0.1;
  7. y = k* x + c; cout << "x = " << x <<
  8. ": y = " << y << "\n";
  9. x = 1; y = k * x + c;
  10. cout << "x = " << x << ": y = " << y << "\n"; x = 5;
  11. y = k * x + c;
  12. cout << "x = " << x << ": y = " << y << "\n";
  13. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
x = 0.1: y = -529432
x = 1: y = -5.29432e+06
x = 5: y = -2.64716e+07