酷代码 AI
菜单

输入n,判断n是否为奇数,是否大于100。 如果n是奇数,并且n>100,输出"Odd and Large"。 如果n是奇数,并且n<=100,输出"Odd and Small"。 如果n是偶数,并且n>100,输出"Even and Large"。 如果n是偶数,并且n<=100,输出"Even and Small"。 输入: 一个整数n。 输出: 如题目描述。 C++14 回答篇幅:简单明了

```cpp #include <iostream> using namespace std; int main() { int n; cin >> n; bool isOdd = n % 2 != 0; bool isLarge = n > 100; if (isOdd && isLarge) { cout << "Odd and Large"; } else if (isOdd && !isLarge) { cout << "Odd and Small"; } else if (!isOdd && isLarge) { cout << "Even and Large"; } else { cout << "Even and Small"; } return 0; } ``` [2026-01-10 19:35:44 | AI问答 | 147点数解答]

服务商
相关提问
发财导航,免费问AI
实用工具查看更多