RedFlys

Home Work 2.5

Oct 28th, 2019
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 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 ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int symbolLength;
  14.             int repeat;
  15.             string name;
  16.             string symbol;
  17.  
  18.             Console.WriteLine("Введите ваше имя:");
  19.             name = Console.ReadLine();
  20.             Console.WriteLine("Введите символ:");
  21.             symbol = Console.ReadLine();
  22.  
  23.             symbolLength = name.Length;            
  24.  
  25.             for (repeat = symbolLength + 4; repeat > 0; repeat--)
  26.             {
  27.                 Console.Write(symbol);
  28.             }
  29.             Console.WriteLine($"\n{symbol} {name} {symbol}");
  30.             for (repeat = symbolLength + 4; repeat > 0; repeat--)
  31.             {
  32.                 Console.Write(symbol);
  33.             }
  34.             Console.ReadKey();
  35.         }  
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment