Code: Select all
got AC
Moderator: Board moderators
Code: Select all
got AC
The \b sequence is intended to be used in output devices that understand it and interpret it in a certain way. The idea is that a string like "fop\bo" appears as "foo". However, a judge bot doesn't work that way, it simply sees "fop\bo" as a different sequence of bytes than "foo".sampad74 wrote:Now,i am getting wrong ans.please,help.thanks in advance.Here is my code..
Code: Select all
#include<stdio.h>
#include<string.h>
int main()
{
int a,b,c,d,e,f,g,h,i,j,k,l;
char m[10000000],n[10000000],o;
while(gets(m))
{
b=strlen(m);
d=0;
c=0;
for(a=0;a<b;a++)
{
if((m[a]>='a' && m[a]<='z') || (m[a]>='A' && m[a]<='Z'))
{
if(c==0)
{
if(m[a]=='a' || m[a]=='e' || m[a]=='i' || m[a]=='o' || m[a]=='u')
{
c=1;
a--;
}
else if(m[a]=='A' || m[a]=='E' || m[a]=='I' || m[a]=='O' || m[a]=='U')
{
c=1;
a--;
}
else
{
o=m[a];
c=2;
a--;
}
}
else if(c==1)
{
while((m[a]>='a' && m[a]<='z') || (m[a]>='A' && m[a]<='Z'))
{
n[d]=m[a];
d++;
a++;
c=0;
}
n[d]='a';
d++;
n[d]='y';
d++;
a--;
}
else if(c==2)
{
a++;
while((m[a]>='a' && m[a]<='z') || (m[a]>='A' && m[a]<='Z'))
{
n[d]=m[a];
d++;
a++;
c=0;
}
n[d]=o;
d++;
n[d]='a';
d++;
n[d]='y';
d++;
a--;
}
}
else
{
n[d]=m[a];
d++;
c=0;
}
}
n[d]='\0';
puts(n);
}
return 0;
}