Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool programopen = true;
- while ( programopen==true)
- {
- Console.WriteLine("Введите имя:");
- string name = Console.ReadLine();
- Console.WriteLine("Введите символ:");
- char symbol = Convert.ToChar(Console.ReadLine());
- int i = 0;
- while (i<name.Length+4) //Печать верхней строки
- {
- Console.Write(symbol);
- i++;
- }
- Console.Write("\n");
- Console.Write(symbol+" "+ name +" "+ symbol); //Печать средней строки с двумя символами,двумя пробелами и именем
- Console.Write("\n");
- i = 0;
- while (i < name.Length + 4) //печать нижней строки
- {
- Console.Write(symbol);
- i++;
- }
- Console.Write("\n");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment