您的位置:首页 > 其它

九度 题目1055:数组逆置

2014-07-25 14:08 295 查看
题目来源:http://ac.jobdu.com/problem.php?pid=1055

时间限制:1 秒

内存限制:32 兆

特殊判题:否

提交:6307

解决:2861

题目描述:

输入一个字符串,长度小于等于200,然后将数组逆置输出。

输入:

测试数据有多组,每组输入一个字符串。

输出:

对于每组输入,请输出逆置后的结果。

样例输入:
hdssg


样例输出:
gssdh


来源:2011年哈尔滨工业大学计算机研究生机试真题

#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

const int MAXN = 210;

int main()
{
char str[MAXN];
while (~scanf("%s", str))
{
int Len = strlen(str);
for(int i = Len-1; i >= 0; --i)
printf("%c", str[i]);
printf("\n");
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: