fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main () {
  6. double a, b, c, d;
  7. int l = 0;
  8. while (cin >> a >> b >> c && a!= -1.0) {
  9. double d1 = 0, d2 = 0;
  10. d1 = a * c / b;
  11. l++;
  12. if (b > d1) {
  13. d2 = (c + d1) * (a + d1) / (b - d1);
  14. cout << fixed << setprecision(4) << "Set" << " " << l << ':' << endl;
  15. cout << d1 + d2<< endl;
  16. }
  17. else cout << fixed << setprecision(4) << "Set" << " " << l << ':' << endl << "Poor King!" << endl;
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 15240KB
stdin
-1 0 0
stdout
Standard output is empty