Write a program that receives a camel case string with no sp
Write a program that receives a camel case string with no spaces and separate all parts based on the character’s case. For example if the input is “IAmHappy” the output should be “I Am Happy”
Beginner-level C++
Thanks!
Solution
#include<iostream>
#include<ctype>
using namespace std;
int main()
{
char *str;
cout<<\"enter a camel case string with no spaces :\";
cin>>str;
int len;
len=str.length();
for(int i=0;i<len;i++)
{
cout<<str[i];
if(isupper(str[i+1]))
cout<<\" \";
}
return 0;
}
