201-Guruh Sherqulov Shaxzod


Download 93.93 Kb.
Sana22.02.2023
Hajmi93.93 Kb.
#1220761
Bog'liq
203-guruh Sherqulov Shaxzod


201-Guruh Sherqulov Shaxzod
8. Faqat kichik lotin harflaridan iborat so'z berilgan. Ushbu so'z palindrom
ekanligini tekshiruvchi rekursiv funksiya hosil qiling.
Dastur kodi:
#include
#include
#include

using namespace std;

int main(){

string words;

cout <<" So'z kiriting : " ;
getline( cin,words );

string wordsReverse( words.rbegin() , words.rend() );


cout << "\nTeskarisiga : " << wordsReverse << endl << endl;

if( words == wordsReverse )


cout << words << " so'zi palindrom !" << endl;
else
cout << words << " So'zi palindrom emas ! " << endl;

system( "pause" );


return 0;
}


Download 93.93 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling