fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. double zaokraglij(double a) {
  5. return round(a*100)/100;
  6. }
  7. int main() {
  8. double a,b,c;
  9. cin>>a>>b>>c;
  10. if (a==0 && c-b!=0)
  11. {
  12. cout<<"NR";
  13. }
  14. else if (a==0 && c-b==0)
  15. {
  16. cout<<"NWR";
  17. }
  18. else{
  19. cout.precision(2);
  20. cout<<fixed<<zaokraglij((c-b)/a);
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 4280KB
stdin
0.00 2.00 2.00
stdout
NWR