Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main() {
- char keyword[] = "bomb";
- char *temp;
- int sign = 0;
- int result = 0;
- for( ; ; ) {
- sign = scanf("%m[a-z]", &temp);
- if (sign == 1) {
- if (strcmp(keyword, temp) == 0) {
- result = 1;
- }
- free(temp);
- sign = scanf("%m[^a-z]", &temp);
- if (sign == 0) {
- break;
- }
- free(temp);
- }
- else {
- break;
- }
- }
- free(temp);
- if (result == 1)
- printf("YES");
- else
- printf("NO");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement