27 lines
498 B
C
27 lines
498 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
int main(void) {
|
|
|
|
char str1[100], str2[100];
|
|
|
|
printf("Digite a primeira palavra: ");
|
|
fgets(str1, 100, stdin);
|
|
|
|
str1[strcspn(str1, "\n")] = '\0';
|
|
|
|
printf("Digite a segunda palavra: ");
|
|
fgets(str2, 100, stdin);
|
|
|
|
str2[strcspn(str2, "\n")] = '\0';
|
|
|
|
if (strcmp(str1, str2) == 0) {
|
|
printf("%s e %s são iguais.\n", str1, str2);
|
|
} else {
|
|
printf("%s e %s não são iguais.\n", str1, str2);
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|