View Code of Problem 84

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

Double click to view unformatted code.


Back to problem 84