fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. float f;
  6. f = 1/2; cout << f << endl;
  7. f = 1.0/2; cout << f << endl;
  8. f = (32.0-6.0) / 100.0 * 20.0; cout << f << endl;
  9. cout << (int)f << endl; //int m = (int)f; смотрите сами какое округление Вам нужно.
  10. return 0;
  11. }
Success #stdin #stdout 0s 4300KB
stdin
Standard input is empty
stdout
0
0.5
5.2
5