Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _2.Matrix_of_Palindromes
- {
- using System;
- using System.Linq;
- using System.Text;
- class Program
- {
- static void Main()
- {
- int[] limitations = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- int rows = limitations[0];
- int cols = limitations[1];
- StringBuilder output = new StringBuilder();
- for (int row = 0; row < rows; row++)
- {
- char firstLetter = (char) ('a' + row);
- for (int col = 0; col < cols; col++)
- {
- output.AppendFormat("{0}{1}{2} ", firstLetter, (char) (firstLetter + col), firstLetter);
- }
- output.AppendLine();
- }
- Console.WriteLine(output.ToString().Trim());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement