Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through these links, eBlogarithm may earn a commission at no extra cost to you. Prices and availability are subject to change.
Hi guys , i just tried the Grasshopper problem , hope you might like it .
#include
int main(){
char a[101];int k=-1,i,max=0,s;
scanf(“%s”,a);
for(i=0;a[i]!=’\0′;i++)
{ if(a[i]==’A’||a[i]==’E’||a[i]==’I’||a[i]==’O’||a[i]==’U’||a[i]==’Y’)
{s=i-k;k=i;
if(s>max)
max=s;}
}s=i-k;
if(s>max)
max=s;
printf(“%d”,max);
return 0;
}
📦 Looking for Codeforces Round 378 Div Problem Grasshopper? Check the best deals on Amazon.
🛒 Shop Codeforces Round 378 Div Problem Grasshopper on Amazon
As an Amazon Associate, eBlogarithm earns from qualifying purchases. Prices and availability are subject to change.
Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through these links, eBlogarithm may earn a commission at no extra cost to you. Prices and availability are subject to change.
Hi guys , i just tried the Grasshopper problem , hope you might like it .
#include
int main(){
char a[101];int k=-1,i,max=0,s;
scanf(“%s”,a);
for(i=0;a[i]!=’\0′;i++)
{ if(a[i]==’A’||a[i]==’E’||a[i]==’I’||a[i]==’O’||a[i]==’U’||a[i]==’Y’)
{s=i-k;k=i;
if(s>max)
max=s;}
}s=i-k;
if(s>max)
max=s;
printf(“%d”,max);
return 0;
}
📦 Looking for Codeforces Round 378 Div Problem Grasshopper? Check the best deals on Amazon.
🛒 Shop Codeforces Round 378 Div Problem Grasshopper on Amazon
As an Amazon Associate, eBlogarithm earns from qualifying purchases. Prices and availability are subject to change.