CODE
#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
using namespace std;
bool nbr(char symb);
void revstring(string & s);
void print1(string s);
void print2(string s);
void print3(string s);
void print4(string s);
void print5(string s);
int main()
{
string s; // original string
cout << "Input a string: ";
getline(cin,s);
cout << endl << "Output: " << endl;
print1(s);
print2(s);
print3(s);
print4(s);
print5(s);
cout << endl;
return 0;
}
bool nbr( char symb )
{
if( symb >= '0' && symb <= '9' )
return true;
else
return false;
}
void revstring(string & s)
{
stack<char> nbrstk;
int i=0;
while( i<s.length() )
nbrstk.push(s[i++]);
i = 0;
while(!nbrstk.empty())
{
s[i++] = nbrstk.top();
nbrstk.pop();
}
}
void print1(string s)
{
for(int i=0; i<s.length(); i++)
cout << s[i];
cout << endl;
}
void print2(string s) // ***Help with this function*** print string in reverse order
{
for (int i=0; i<s.length(); i--)
cout << s[i];
cout << endl;
}
void print3( string s ) // Help with this function* print string with every sequence of numbers within string in reverse order
{
for (int=0; i<s.length(); i++)
revstring (string & s)
cout << s[i];
cout << endl;
}
void print4(string s) // ***Help with this function*** determine if string is palindrome (same order when reversed)
{
while (i= <s.length () )
{
symb=s[i]
if (!nbr (symb) )
{
cout<< symb;
i++;
}
else
while (nbr (symb) )
{
nbrstk.push (symbl)
symb= s (i++);
cout<< "Not a Palindrome";
}
void print5( string s ) // ***Help with this function*** determine the length of the string at beginning that is palindrome
{
cout<< "The first"<< << "characters form a palindrome."
}