View Code of Problem 84

#include<stdio.h>
#include<string.h>

int main(){
	int i,len;
	char str[1000];
	while(gets(str))
	{
		len=strlen(str);
		for (i=0;i<len-3;i++)
		{
			if(str[i]=='s' || str[i]=='S')
				if(str[i+1]=='a' || str[i+1]=='A')
				  if(str[i+2]=='l' || str[i+2]=='L')
						if(str[i+3]=='t' || str[i+3]=='T')
						  {
							for (i=0;i<len;i++)
						     printf("%c",str[i]);
                             printf("\n");
							break;
						}
		}                         
							
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 84