Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace o
- {
- class Program
- {
- public static void Main(string[] args)
- {
- Console.WriteLine("texte :");
- string texte = Console.ReadLine();
- char[] tabChar = texte.ToCharArray();
- string rep = "";
- for (int i = tabChar.Length ;i != 0;i--) {
- Console.Write(tabChar[i-1]);
- rep = rep + tabChar[i-1];
- }
- if (rep == texte){
- Console.WriteLine("\nC UN PALINDROME");
- }
- else{
- Console.WriteLine("\nCe n'est pas un palindrome");
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement