首页 > 其他 > 详细

杭电ACM1321——Reverse Text~~逆序输出字符串

时间:2015-05-22 17:12:59      阅读:255      评论:0      收藏:0      [点我收藏+]

简单的字符串逆序输出。

AC代码:

#include <iostream>
#include <cstring>
using namespace std;

int main()
{
	char str[100000];
	int n;
	while(cin >> n)
	{
		getchar();
		for(int i = 0; i < n; i++)
		{
			gets(str);
			int length = strlen(str);
			for(int j = length - 1; j >= 0; j--)
				cout << str[j];
			cout << endl;
		}
	}
	return 0;
}


杭电ACM1321——Reverse Text~~逆序输出字符串

原文:http://blog.csdn.net/qq_25425023/article/details/45917801

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!