Created
February 6, 2025 19:01
-
-
Save eu9ene9/739928de327afb26bf049feebb12c80f to your computer and use it in GitHub Desktop.
ДЗ: Вывод имени
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text; | |
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
string userName; | |
string symbol; | |
Console.Write("Ввежите ваше имя: "); | |
userName = Console.ReadLine(); | |
Console.Write("Введите символ: "); | |
symbol = Console.ReadLine(); | |
for (int i = 0; i < userName.Length + 3; i++) | |
{ | |
if(userName.Length != i) | |
{ | |
Console.Write($"{symbol}"); | |
} | |
} | |
Console.WriteLine(""); | |
Console.WriteLine($"{symbol}{userName}{symbol}"); | |
for (int i = 0; i < userName.Length + 3; i++) | |
{ | |
if (userName.Length != i) | |
{ | |
Console.Write($"{symbol}"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment