Results 1 to 3 of 3
Thread: (++)
Hybrid View
-
3rd May 2011 12:00 #1Registered User
Join Date: Jan:2009
Location:
Posts: 16
(++)
, , , ( )
#include <iostream>
#include <string>
using namespace std;
int main()
{
char str[100];
cout << "Enter a word to check if it is a palindrome:";
cin >> str;
int x = strlen(str)-1;
for(int i = 0; i <= x; i++)
{
if (str[i] == str[x-i])
{
continue;
}
else
{
cout<<"NO"<<endl;
system ("pause");
return 0;
}
}
cout << "YES"<<endl;
system ("pause");
return 0;
}
:
char str[100];
cout << "Enter a word to check if it is a palindrome:";
cin >> str;
int x = strlen(str)-1;
for(int i = 0; i <= x; i++)
{
if (str[i] == str[x-i])
----------------------------
char str ?
? ? !
-
3rd May 2011 12:24 #2
-
3rd May 2011 12:29 #3Registered User
Join Date: Jan:2009
Location:
Posts: 16
Gracias!




Reply With Quote


Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in