21 lines
315 B
C
21 lines
315 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
int main(void) {
|
|
|
|
char word[100];
|
|
|
|
printf("Digite a palavra: ");
|
|
fgets(word, 100, stdin);
|
|
|
|
word[strcspn(word, "\n")] = '\0';
|
|
|
|
for (int i = strlen(word) - 1; i >= 0; i--) {
|
|
printf("%c", word[i]);
|
|
}
|
|
printf("\n");
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|