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 != 0 || number > 200) {
- cout << "invalid" << endl;
- }
- return 0;
- }
- Решение с тернарен оператор:
- #include <iostream>
- using namespace std;
- int main() {
- int number;
- cin >> number;
- cout << (number < 100 && number != 0 || number > 200 ? "invalid" : "") << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement