View Code of Problem 84

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main (){
	char str[1010];
	while(gets(str)){
		char s[1010];
		for(int i = 0;i < strlen(str);i++){
			if(str[i]>='A'&&str[i]<='Z'){
				s[i] = str[i]+32;
			}else{
				s[i] = str[i];
			}
		}
//		printf("%s\n", s);
		int flag = 0;
		for(int i = 0;i < strlen(str);i++){
			if(s[i]=='s'&&s[i+1]=='a'&&s[i+2]=='l'&&s[i+3]=='t'){
				flag = 1;
				break;
			}
		}
		if(flag) printf("%s\n", str);
	}

	return 0;
}

Double click to view unformatted code.


Back to problem 84