Problem 19

One comment on “Problem 19”


  • Chandra Chandu

    #include
    using namespace std;
    int main()
    {
    int n,i,j;
    string s,s1=””;
    getline(cin,s);
    for(i=0;i<s.length();i++)
    {
    if(s[i]!=' '||i==s.length()-1)
    {
    s1=s1+s[i];
    }
    else
    {
    reverse(s1.begin(),s1.end());
    cout<<s1<=0;i–)
    {
    if(s[i]!=’ ‘)
    {
    cout<<s[i];
    }
    else
    return 0;
    }
    }