View Code of Problem 84

#include<stdio.h>
#include<string.h>
int main()
{
	char str[100];
	
	int i,len;
	while(gets(str)!=NULL)
	{
		int k=0,flag=0;
		len=strlen(str);
		for(i=0;i<len;i++)
		{
			if(str[i]=='s'||str[i]=='S')
			{
				k++;
			}
			else if((str[i]=='A'||str[i]=='a')&&k==1)
			{
				k++;
			}
			else if((str[i]=='l'||str[i]=='L')&&k==2)
			{
				k++;
			}
			else if((str[i]=='t'||str[i]=='T')&&k==3)
			{
				k++;
				flag=1;
				break;
			
			}
			else
			{
				k=0;
			}
			
		}
		if(flag)
			puts(str);
		
	}
	
	
	
	return 0;
}

Double click to view unformatted code.


Back to problem 84