码迷,mamicode.com
首页 > 其他好文 > 详细

回文数扩展--长字符串版

时间:2014-09-11 17:19:22      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:c++   回文数   

//回文数扩展 长字符串版
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string str,s;
	cin>>str;

	int n=str.size();
	for(int i=n-1;i>=0;i--)
	{
		s.push_back(str[i]);
	}

	if(str==s)
	{
		cout<<"是回文"<<endl;
	}
	else
	{
		cout<<"不是回文"<<endl;
	}

	system("pause");
	return 0;
}


bubuko.com,布布扣

回文数扩展--长字符串版

标签:c++   回文数   

原文地址:http://blog.csdn.net/lanzhihui_10086/article/details/39207987

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!