eolymp
bolt
Try our new interface for solving problems
Problems

The number-palindrome

published at 2/19/17, 12:12:05 pm

Решаю через файлы ввода и вывода, все тесты - неправильный ответ, на компе все хорошо

published at 11/28/17, 7:40:38 pm

7 тест даёт ошибку

published at 2/3/24, 9:05:04 pm

Які значення до сьомого тесту?

published at 3/1/24, 3:46:19 pm

include <bits/stdc++.h>

using namespace std; int main(){ string s; cin >> s;

int size=s.length();
string s1=s;
reverse(s1.begin(),s1.end());

int result1;
stringstream(s) >> result1;
int result2;
stringstream(s1) >> result2;
if(result1==result2){
    cout << "Yes" << endl;
}
else {
    cout << "No" << endl;
}

}

published at 4/14/24, 12:45:43 pm

include <iostream>

include <string>

using namespace std;

bool isPalindrome(string str) { int left = 0; int right = str.length() - 1;

while (left < right) {
    if (str[left] != str[right])
        return false;

    left++;
    right--;
}

return true;

}

int main() { string num; cin >> num;

if (isPalindrome(num)) {
    cout << "Yes" << endl;
} else {
    cout << "No" << endl;
}

return 0;

}