Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- int rows = int.Parse(Console.ReadLine());
- int cols = int.Parse(Console.ReadLine());
- char mainCharacter;
- string alphabet1 = "abcdefghijklmnopqrstuvwxyz";
- char[] alphabet = alphabet1.ToArray();
- char helpCharacter;
- string[,] matrix = new string[rows, cols];
- for (int row = 0; row < matrix.GetLength(0); row++)
- {
- for (int col = 0; col < matrix.GetLength(1); col++)
- {
- string output = string.Empty;
- mainCharacter = alphabet[row];
- helpCharacter = alphabet[col + row];
- string outMain = mainCharacter.ToString();
- string outHelp = helpCharacter.ToString();
- output += mainCharacter;
- output += helpCharacter;
- output += mainCharacter;
- output += " ";
- matrix[row, col] = output;
- }
- }
- for (int i = 0; i < matrix.GetLength(0); i++)
- {
- for (int j = 0; j < matrix.GetLength(1); j++)
- {
- Console.Write(matrix[i, j]);
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment