fork download
  1. #include<iostream>
  2. #include <iomanip>
  3. float Calc(float A, float B){
  4. float C = A * B;
  5.  
  6. return C;
  7. }
  8.  
  9. float Calc2(float A, float B){
  10. float C = A / B;
  11.  
  12. return C;
  13. }
  14. float Calc2D(double A, double B){
  15. double C = A / B;
  16.  
  17. return C;
  18. }
  19. int main(){
  20.  
  21. std::cout << Calc(110.6, 18) << std::endl;
  22. std::cout << Calc(110.6, 19) << std::endl;
  23. std::cout << Calc(110.6, 20) << std::endl;
  24. std::cout << Calc(1106, 19) << std::endl;
  25. std::cout << Calc(110.5, 19) << std::endl;
  26.  
  27. std::cout << std::fixed /*<< std::setprecision(1)*/ << Calc2(214358881, 11) << std::endl;
  28. std::cout << std::fixed /*<< std::setprecision(1)*/ << Calc2(965782365, 19) << std::endl;
  29. std::cout << std::fixed /*<< std::setprecision(1)*/ << Calc2D(214358881, 11) << std::endl;
  30. std::cout << std::fixed /*<< std::setprecision(1)*/ << Calc2D(965782365, 19) << std::endl;
  31.  
  32. return 0;
  33. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1990.8
2101.4
2212
21014
2099.5
19487170.000000
50830648.000000
19487172.000000
50830652.000000