Vapio

task11

Mar 5th, 2021 (edited)
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         string name;
  8.         char sign;
  9.        
  10.         Console.WriteLine("Please input name : ");
  11.         name = Console.ReadLine();
  12.        
  13.         int columnsCount = name.Length + 2;
  14.        
  15.         Console.WriteLine("Please input sign : ");
  16.         sign = Convert.ToChar(Console.ReadLine());
  17.        
  18.         for (int j = 0; j < columnsCount; ++j)
  19.             Console.Write(sign);
  20.        
  21.         Console.WriteLine("\n"+sign+name+sign);
  22.        
  23.         for (int j = 0; j < columnsCount; ++j)
  24.             Console.Write(sign);
  25.     }
  26. }
Add Comment
Please, Sign In to add comment