Advertisement
xomanya

2.5

Aug 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 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 DZ2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.Write("Введите Ваше имя: ");
  14.             string name = Console.ReadLine();
  15.             Console.Write("Введите символ: ");
  16.             char ch = Convert.ToChar(Console.ReadLine());
  17.             Console.WriteLine("\nА теперь фокус!");
  18.             name = ch + name + ch;
  19.            
  20.             int i= 0;
  21.             while (i < name.Length)
  22.             {
  23.                 Console.Write(ch);
  24.                 i++;
  25.             }
  26.             i = 0;
  27.             Console.WriteLine("\n" + name);
  28.             while (i < name.Length)
  29.             {
  30.                 Console.Write(ch);
  31.                 i++;
  32.             }
  33.             Console.WriteLine("");
  34.  
  35.         }    
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement