Advertisement
Gudini

Homework2_7

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