fork(19) download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. float a = 0.0,
  10. b = 0.0,
  11. c = 0.0;
  12.  
  13. cout<<"Input a: ";
  14. cin>>a;
  15. cout<<"input b: ";
  16. cin>>b;
  17. cout<<endl;
  18. c = a / b;
  19. c = floor(100 * c) / 100;
  20. cout<<"Result: "<<fixed<<setprecision(2)<<c<<endl;
  21. }
Success #stdin #stdout 0s 3432KB
stdin
513
791
stdout
Input a: input b: 
Result: 0.64