题目描述
输入一个字符串,长度小于等于200,然后将数组逆置输出。
输入
测试数据有多组,每组输入一个字符串。
输出
对于每组输入,请输出逆置后的结果。
样例输入
tianqin
样例输出
niqnait
提示
注意输入的字符串可能会有空格。
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<iostream>
using namespace std;
int main()
{
char s[210];
while(gets(s)!=NULL)
{
reverse(s, s+strlen(s));
puts(s);
}
return 0;
}
/**************************************************************
Problem: 1967
User: 151210132
Language: C++
Result: 正确
Time:0 ms
Memory:2020 kb
****************************************************************/