Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 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. namespace СSLight13
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             string[,] file = { {"Имя"}, {"Отчество"} };
  15.            
  16.             string addToFile = Console.ReadLine();
  17.  
  18.             string[,] tempFile = new string[file.Length + 1, 0];
  19.             for (int i = 0; i < file.Length; i++)
  20.             {
  21.                 for (int j = 0; j < file.Length; j++)
  22.                 {
  23.                     tempFile[i, j] = file[i, j];
  24.                 }
  25.             }
  26.             tempFile[tempFile.GetLength(0) - 1, 0] = addToFile;
  27.             file = tempFile;
  28.  
  29.  
  30.             for (int i = 0; i < file.GetLength(0); i++)
  31.             {
  32.                 for (int j = 0; j < file.GetLength(1); j++)
  33.                 {
  34.                     Console.Write(file[i, j] + " ");
  35.                 }
  36.                 Console.WriteLine();
  37.             }
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement