using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication6
{
class Program
{
static void Main(string[] args)
{
string s = Console.ReadLine();
int i, j;
string s2 = "",s3="";
for (i = 0; i < s.Length; i++)
{
s2 = "";
s2 = s[i].ToString();
for (j = i + 1; j < s.Length; j++)
{
s2 += s[j];
s3 = rev(s2.Trim());
if(s2.Equals(s3))
{Console.WriteLine(s2);
}
}
}
Console.ReadKey();
}
static string rev(String s)
{
string s3="";
for (int i = 0; i < s.Length; i++)
s3 = s[i] + s3;
return s3;
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication6
{
class Program
{
static void Main(string[] args)
{
string s = Console.ReadLine();
int i, j;
string s2 = "",s3="";
for (i = 0; i < s.Length; i++)
{
s2 = "";
s2 = s[i].ToString();
for (j = i + 1; j < s.Length; j++)
{
s2 += s[j];
s3 = rev(s2.Trim());
if(s2.Equals(s3))
{Console.WriteLine(s2);
}
}
}
Console.ReadKey();
}
static string rev(String s)
{
string s3="";
for (int i = 0; i < s.Length; i++)
s3 = s[i] + s3;
return s3;
}
}
}
Comments