Askor

Hw12

Jun 30th, 2020 (edited)
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Test
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string userInput;
  10.             char symbol;
  11.             int quantitySymbols;
  12.  
  13.             Console.Write("Input some string: ");
  14.             userInput = Console.ReadLine();
  15.             quantitySymbols = Convert.ToInt32(userInput.Length);
  16.  
  17.             Console.Write("Input some char: ");
  18.             symbol = Convert.ToChar(Console.ReadLine());
  19.  
  20.             for (int i = 0; i < quantitySymbols; i++)
  21.             {
  22.                 Console.Write(symbol);
  23.                 if (i == userInput.Length + 1)
  24.                 {
  25.                     Console.WriteLine();
  26.                     Console.WriteLine($"{symbol}{userInput}{symbol}");
  27.                 }
  28.             }
  29.         }
  30.     }
  31. }
Add Comment
Please, Sign In to add comment