Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- double num = 0;
- int newnum;
- setlocale(LC_ALL, "ru");
- cout << "Введите вещественное число" << endl;
- cin >> num;
- newnum = int(num * 100 + 0.5) / 100.0;
- cout << "Вы ввели число " << num << " которое после округления = " << newnum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement