It passed sample test case but when submitted all case failed why?

#include
#include
#include<ctype.h>
using namespace std;

int main()
{
string s;
s=“IAmACompetitiveProgrammer”;
int j,k=0;
for(int i=0;i<s.length();i++)
{
if(isupper(s[i]))
{
for(j=k;j<i;j++)
{
cout<<s[j];
}
if(i!=0){
cout<<endl;}
k=i;
}

}
for(int i=k;s[i]!=’\0’;i++)
{
cout<<s[i];
}
}

@345avamanverma all test cases dont contain the string of sample test case you have assigned the the string to s but you have to take input.


i hope its clear if yes dont forget to mark it as resolved

OH MY MISTAKE SORRY!