fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a = 10, b = 5, c = 3, d = 1;
  6. int x = 3, y = 2, z = 2;
  7.  
  8. float res = (float) a/x + b/y + c/z + d;
  9. cout << res << endl;
  10. float res2 = (float) a/x + (float)b/y + (float)c/z + d;
  11. cout << res2 << endl;
  12. return 0;
  13. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
7.33333
8.33333