فحص الـ Palindrome — تحدي C++
اكتب الدالة isPalindrome(text) التي ترجع true إذا كان النص متماثلاً بعد تجاهل المسافات والرموز وحالة الأحرف.
#include <iostream>
#include <string>
using namespace std;
bool isPalindrome(string text) {
// اكتب الحل هنا
}
int main() {
cout << isPalindrome("radar") << endl; // 1
cout << isPalindrome("hello") << endl; // 0
cout << isPalindrome("A man a plan a canal Panama") << endl; // 1
return 0;
}حل هذا التحدي يرتبط بفتح دورة «المؤشرات والذاكرة» بحسابك.
ابدأ الحل