View Code of Problem 121

#include<stdio.h>
#include<string.h>
int main()
{
	char s[1000];
	int i,j,k;
	while(gets(s)!=NULL)
	{
		k=0;
		for(i=0;i<strlen(s);i++)
		{
			if(s[i]=='o'&&k==0)
			{
				k++;
				continue;
			}
			else if(s[i]=='c'&&k==1)
			{
				k++;
				continue;
			}
			else if(s[i]=='c'&&k==2)
			{
				k++;
				continue;
			}
			else if(s[i]=='u'&&k==3)
			{
				k++;
				continue;
			}
			else if(s[i]=='p'&&k==4)
			{
				k++;
				continue;
			}
			else if(s[i]=='a'&&k==5)
			{
				k++;
				continue;
			}
			else if(s[i]=='t'&&k==6)
			{
				k++;
				continue;
			}
			else if(s[i]=='i'&&k==7)
			{
				k++;
				continue;
			}
			else if(s[i]=='o'&&k==8)
			{
				k++;
				continue;
			}
			else if(s[i]=='n'&&k==9)
				k++;
			
			if(k==10)
			{
				printf("OH-OH-OH-QQ-PEI-PEI-SHION");
				k=0;
			//	printf("%c",s[i]);
					
			}		
			else
			{
				for(j=i-k;j<=i;j++)
					printf("%c",s[j]);
				k=0;
			}
		}
		printf("\n");
		
		
	}
	
	
	
	
	
	
	return 0;
}

Double click to view unformatted code.


Back to problem 121