Advertisement
Razhagal

Matrix of Polidromes

Mar 31st, 2014
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. class MatrixOfPolidromes
  8. {
  9.     static void Main()
  10.     {
  11.         int matrixRows = int.Parse(Console.ReadLine());
  12.         int matrixCols = int.Parse(Console.ReadLine());
  13.  
  14.         string[,] polidromesMatrix = new string[matrixRows, matrixCols];
  15.  
  16.         for (int row = 0; row < matrixRows; row++)
  17.         {
  18.             for (int col = 0; col < matrixCols; col++)
  19.             {
  20.                 polidromesMatrix[row, col] = "" + (char)('a' + row) + (char)('a' + row + col) + (char)('a' + row);
  21.  
  22.                
  23.             }
  24.         }
  25.  
  26.         for (int row = 0; row < matrixRows; row++)
  27.         {
  28.             for (int col = 0; col < matrixCols; col++)
  29.             {
  30.                 Console.Write(polidromesMatrix[row, col] + " ");
  31.             }
  32.             Console.WriteLine();
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement