题解
2024-07-21 17:53:58
发布于:广东
1阅读
0回复
0点赞
#include <iostream>
using namespace std;
int main() {
// Step 1: Read the input character
char ch;
cin >> ch;
// Step 2: Check if the ASCII value of the character is odd
bool isOdd = (ch % 2) != 0; // Here, we use the modulo operator to check for oddness
// Step 3: Output the result based on the oddness check
if (isOdd) {
cout << "YES";
} else {
cout << "NO";
}
return 0;
}
这里空空如也
有帮助,赞一个