fork download
  1. #include <iostream> // da 2+2=5.cpp 1 april 2020
  2. #include <cmath>
  3. using namespace std; int main()
  4. { setlocale (LC_ALL, "RUS");
  5.  
  6. double a = 2.4, b = 2.4; double c;
  7. c = a + b;
  8. cout << round(a) << " + "<< round(b) << " = "<< round(c) << "\n";
  9.  
  10. double d,v; d = -2.4, a = -2.4;
  11. v = d + a;
  12. cout << round(d) << " " << round(a) << " = "<< round(v) << endl;
  13. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
2 + 2 = 5
-2 -2 = -5