Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- bool isMutable(float mutableNumber, float number)
- {
- if (mutableNumber + number != mutableNumber)
- return true;
- return false;
- }
- int main()
- {
- vector<float> numbers = {2.5e15, 75000, 300000000, 1.5e7};
- for (float number : numbers)
- {
- cout << endl;
- if (!isMutable(number, static_cast<float>(1000)))
- {
- cout << "Число " << number << " не изменится при добавлении 1000";
- continue;
- }
- if (!isMutable(number, static_cast<float>(100)))
- {
- cout << "Число " << number << " не изменится при добавлении 100";
- continue;
- }
- if (!isMutable(number, static_cast<float>(1)))
- {
- cout << "Число " << number << " не изменится при добавлении 1";
- continue;
- }
- cout << "Число " << number << " ИЗМЕНЯЕТСЯ при добавлении 1";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement