No output coming in this question

I have tried the CanYouReadThis? question in the following manner but no output is coming can you please help .
this is my code.
#include
#include
#include<string.h>
using namespace std;
int main() {
string s;
cin>>s;
int x=-1;
for(int i=x+1;i<s.length();i++)
{
int z=s[i]-‘a’;
if((z>=65)&&(z<=90))
{
x=i;
string a=s.substr(i,x);
cout<<a<<endl;
}
}
return 0;
}

Hi Dhruv, pls save your code here and the share the link on this thread so that we can help you asap :slight_smile:.

the output is not coming because of your z value
if string is of upper case then value of z is negative
and if string is of lower case then value of z will be 0-26
in both case the if condition will not satisfy thats why output is not coming