所以我的代码读入一个单词并将其显示给用户反词。这就是我所拥有的:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
int i;
char word[10];
printf("Enter a six letter word: ");
for(i=0; i<6; i++){
scanf("%c", &word[i]);
}
for (i=5; i>=0; i--){
printf("%c", word[i]);
}
return 0;
}
我将如何使用 getchar 和 putchar 而不是使用 scanf 和 printf?