Failure in few test cases

i have no idea why my following case failing few test cases.
plz help.

#include
using namespace std;
int main() {
char str[1000];
cin>>str;
int length = 0;
int i =0;
while(str[i]!= ‘\0’){
length++;
i++;

}
int current=1;

cout<<str[0];
for(int i=1; i<length;i++){
	char temp[1000];
	int t=0;
	while(str[current]>95){
		temp[t]=str[current];
		current++;
		t++;
	}
	temp[t]='\0';
	cout<<temp<<endl;
	
	cout<<str[current];
	current++;
	
	
	
	i=current-1;
}



return 0;

}

you need to add extra break conditions
Corrected Code

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.