回文串
什么回文串;列如noon
/*
* 由SharpDevelop创建。
* 用户: Administrator
* 日期: 2018/10/20
* 时间: 13:16
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using System;
namespace C回文串
{
class Program
{
public static void Main(string[] args)
{
string str=Console.ReadLine();
bool isHui=true;
for (int i = 0; i < str.Length /2; i++) {
if (str[i]!=str[str.Length-1-i]) {
isHui=false;
break;
}
}if (isHui ) {
Console.WriteLine("是回文串");
}else{
Console.WriteLine("不是回文串");
}
// TODO: Implement Functionality Here
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}
}
noon
是回文串
fglhjg
不是回文串

浙公网安备 33010602011771号