Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int number;
- cin >> number;
- if (number >= -100 && number <= 100 && number != 0) {
- cout << "Yes" << endl;
- }
- else {
- cout << "No" << endl;
- }
- return 0;
- }
- Решение с тернарен оператор:
- #include <iostream>
- using namespace std;
- int main() {
- int number;
- cin >> number;
- cout << (number >= -100 && number <= 100 && number != 0 ? "Yes" :"No") << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement