fork download
  1. using System;
  2. public class Test
  3. {
  4. public static void Main()
  5. {
  6.  
  7. string example = "Michael";
  8. IsBothEndsPalindrome(example, 3);
  9. }
  10.  
  11. static void IsBothEndsPalindrome(string s, int i) {
  12. while(i-- > 0) {
  13. Console.WriteLine("{0} {1}", s[i], s[s.Length - i - 1]);
  14. }
  15. }
  16. }
Success #stdin #stdout 0.03s 36936KB
stdin
Standard input is empty
stdout
c a
i e
M l