/* 编写一个程序把一个单词读入一个字符数组,然后反向打印出这个词。 提示:使用strlen()(第4章)计算数组中最后一个字符的索引。 */ #include <stdio.h> #include <string.h> #define WORD_SIZE 26 int main (void) { char word[WORD_SIZE]; int i; printf("Input a word:/n"); scanf("%s",word); i = strlen(word); for(;i >= 0; i--) printf("%c",word[i]); system("pause"); return 0; }