79159906

Date: 2024-11-05 16:27:25
Score: 0.5
Natty:
Report link

You'll need #include <string.h> to use strstr() like this:

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

int main() {
    char str[100];
    printf("How are you feeling right now? ");
    fgets(str, sizeof(str), stdin);

    if (strstr(str, "good") != NULL)
        printf("I'm glad to hear that!\n");
    else if (strstr(str, "tired") != NULL)
        printf("Take some rest!\n");
    else
        printf("Thank you for sharing.\n");

    return 0;
}
Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: kazcfz