Advertisement
MaksNew

lab3K

Jun 21st, 2021
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     double num = 0;
  7.     int newnum;
  8.     setlocale(LC_ALL, "ru");
  9.     cout << "Введите вещественное число" << endl;
  10.     cin >> num;
  11.     newnum = int(num * 100 + 0.5) / 100.0;
  12.     cout << "Вы ввели число " << num << " которое после округления = " << newnum;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement