Page 1 of 1

A help

Posted: Mon Sep 29, 2003 9:00 am
by joydip
Thanks I Get run time error on this problem but when i see
yours code then I find why an fix the max size and got accepted
I have no time now
Pleas cheak out
my Ac code
I think you will try in your own way
Thank..................
#include<stdio.h>
#include<string.h>
long int max=1000000;
int main()
{
char sa[max];
long int tt,c,x,k,vowel=0;
while(gets(sa))
{
x=0;
x=strlen(sa);
for(k=0;k<x;k++)
{
vowel=0;
if((sa[k]>64&&sa[k]<91)||(sa[k]>96&&sa[k]<123))
{
c=sa[k];
if(sa[k]=='a'||sa[k]=='A'||sa[k]=='e'||sa[k]=='E'||sa[k]=='i'||sa[k]=='I'||sa[k]=='o'||sa[k]=='O'||sa[k]=='u'||sa[k]=='U')
{
k=k;
vowel=1;
}
else
k=k+1;

while((sa[k]>64&&sa[k]<91)||(sa[k]>96&&sa[k]<123))
{
printf("%c",sa[k]);
k++;
}
if(vowel==1)
printf("ay",c);
else
printf("%cay",c);
while(k)
{
if(k==x)
{
printf("\n");
break;
}
tt=0;
if(sa[k]<=64)
{
printf("%c",sa[k]);
k++;
tt=1;
}
if(sa[k]>=91&&sa[k]<=96)
{
printf("%c",sa[k]);
k++;
tt=1;
}
if(sa[k]>=123)
{
printf("%c",sa[k]);
k++;
tt=1;
}
if(tt==0)
{
k--;
break;
}

}
}
}

}

return 0;
}