67 128
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #55035 in C++ for paul

Question #55035
write a program that reads a line of text ,changes each uppercase letter to lowercase ,and places each letter both in a queue and onto a stack .The program should then verify whether the line of text is apalindrome (a set of letter or numbers that is the same whether read forward or backward)
Expert's answer
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
std::string text;
cout << "Please, enter string:\n";
getline(std::cin, text);
std::transform(text.begin(), text.end(), text.begin(), ::tolower);
cout << text << endl;
if (text == string(text.rbegin(), text.rend()))
cout << text << " is a palindrome\n";
else
cout << text << " is not a palindrome\n";
system("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions