#include <iostream>
#include <string>
usingnamespace std ;
int main ()
{
string s = "wish for my luck" , e= "thanks" , f ;
int x , n ;
cout<<s<<endl;
cout<<"anything to say? enter without space"<<endl;
cin>>f ;
cout<<f<<endl ;
n=f.length() ;
if (x=n)
cout<<e<<endl ;
system ("pause") ;
return 0 ;
the problem is when the people enter f with space cout<<f ; just print the first word, how to solve this problem?