Advertisement
junniorrkaa

Вывод имени

Aug 21st, 2024 (edited)
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | Source Code | 0 0
  1. using System;
  2.  
  3. namespace CSLight
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string nameInput;
  10.             string symbolInput;
  11.             string middleString;
  12.             string symbolsName = "";
  13.             int frame;
  14.  
  15.             Console.Write("Введите имя: ");
  16.             nameInput = Console.ReadLine();
  17.  
  18.             Console.Write("Введите символ: ");
  19.             symbolInput = Console.ReadLine();
  20.  
  21.             middleString = symbolInput + nameInput + symbolInput;
  22.             frame = middleString.Length;
  23.  
  24.             for (int i = 0; i < frame; i++)
  25.             {
  26.                 symbolsName += symbolInput;
  27.             }
  28.  
  29.             Console.WriteLine($"\n {symbolsName} \n {middleString} \n {symbolsName} \n");
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement