Unable to solve this question
CanYouReadThis?
hi aniket
Problem can be solved by dividing the input string at position, i, either if is the last letter, or is a capital letter.
simple approach to this question can be if at any point we have upper case character then go to the next line and cout that character and continue;
else
just keep printing the characters
reference
string a;
cin>>a;
cout<<a[0];
for(int i=1;i<a.size();i++)
{
if(isupper(a[i]))
{
cout<<endl;
cout<<a[i];
continue;
}
else
{
cout<<a[i];
}
}
3 Likes
Thank you for this code.I got it