#include
#includeint main(void) {
char nameA[100], nameB[100], decision[4];
fgets(nameA, sizeof(nameA), stdin);
nameA[strcspn(nameA, "\n")] = '\0';
fgets(nameB, sizeof(nameB), stdin);
nameB[strcspn(nameB, "\n")] = '\0';
fgets(decision, sizeof(decision), stdin);
decision[strcspn(decision, "\n")] = '\0';
if (strcmp(decision, "yes") == 0) printf("%s想和%s絕交\n", nameA, nameB);else if (strcmp(decision, "no") == 0) printf("%s不想和%s絕交\n", nameA, nameB);
else printf("輸入無效的决定\n");
return 0;
}
#include <stdio.h>
#include <ctype.h>int main(void) {
char nameA[100], nameB[100], decision[4];
fgets(nameA, sizeof(nameA), stdin);
nameA[strcspn(nameA, "\n")] = '\0';
fgets(nameB, sizeof(nameB), stdin);
nameB[strcspn(nameB, "\n")] = '\0';
fgets(decision, sizeof(decision), stdin);
decision[strcspn(decision, "\n")] = '\0';
if (strcmp(decision, "yes") == 0) printf("%s想和%s絕交\n", nameA, nameB);else if (strcmp(decision, "no") == 0) printf("%s不想和%s絕交\n", nameA, nameB);
else printf("輸入無效的决定\n");
return 0;
}
#include <stdio.h>
#include <string.h>int main(void) {
char nameA[100], nameB[100], decision[4];
fgets(nameA, sizeof(nameA), stdin);
nameA[strcspn(nameA, "\n")] = '\0';
fgets(nameB, sizeof(nameB), stdin);
nameB[strcspn(nameB, "\n")] = '\0';
fgets(decision, sizeof(decision), stdin);
decision[strcspn(decision, "\n")] = '\0';
if (strcmp(decision, "yes") == 0) printf("%s想和%s絕交\n", nameA, nameB);else if (strcmp(decision, "no") == 0) printf("%s不想和%s絕交\n", nameA, nameB);
else printf("輸入無效的决定\n");
return 0;
}