Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 1) Проверить палиндром
- */
- #include <iostream>
- using namespace std;
- int main()
- {
- const int N = 100000;
- char S[N];
- cin.getline(S, N);
- int a = strlen(S);
- bool ok = true;
- for (int i = 0, j = a - 1; i < j; i++, j--)
- {
- if (S[i] != S[j])
- {
- ok = false;
- break;
- }
- }
- if (ok)
- {
- cout << "Yes";
- }
- else
- {
- cout << "No";
- }
- }
Add Comment
Please, Sign In to add comment