#include <iostream>
#include <string>
bool is_palindrome(const std::string& s) {
std::string r(s);
std::reverse(r.begin(), r.end());
return s == r;
}
int main() {
std::string s1,s2;
setlocale(LC_ALL, "Russian");
std::cout << "Введите число 1: ";
std::getline(std::cin, s1);
std::cout << "Введите число 2: ";
std::getline(std::cin, s2);
if (is_palindrome(s1)|| is_palindrome(s2))
std::cout << "Одно из введенных чисел является палиндромом " << std::endl;
else
std::cout << "Ни одно из введенных чисел не является палиндромом " << std::endl;
return 0;
}
Объяснение:
No or not?
Grammar > Easily confused words > No or not?
из English Grammar Today
No and not are the two most common words we use to indicate negation. We use no before a noun phrase:
There’s no address on the envelope.
[parent to child]
No biscuits before dinner!
No decisions have been made.
We use not with any other phrase or clause:
It’s not often that you stop and think about the way you breathe.
Not suitable for children under 15.
Not surprisingly, it was a tense match but eventually the more experienced Australians won.
A:
Do you go cycling all year round?
B:
Not in the winter.