View Code of Problem 84

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<malloc.h>
 
int main(){
	char a[100];
	while (gets(a) != NULL) {
		int n = strlen(a);
		for (int i = 0;i <= n - 4;i++) {
			if (a[i] == 's' || a[i] == 'S') {
				if (a[i + 1] == 'a' || a[i + 1] == 'A') {
					if (a[i+2] == 'l' || a[i+2] == 'L') {
						if (a[i+3] == 't' || a[i+3] == 'T') {
							printf("%s\n", a);
							break;
						}
					}
				}
			}
		}
	}
	
 
}

Double click to view unformatted code.


Back to problem 84