题目链接:http://codeup.cn/problem.php?cid=100000580&pid=5
题目描述
输入一个字符串,长度小于等于200,然后将数组逆置输出。
输入
测试数据有多组,每组输入一个字符串。
输出
对于每组输入,请输出逆置后的结果。
样例输入
tianqin
样例输出
niqnait
代码
#include<stdio.h>
#include<string.h>
int main() {
char a[210];
while(gets(a)) {
int len = strlen(a);
for(int i = len - 1; i >=0; i--) {
printf("%c", a[i]);
}
printf("\n");
}
}