BonchoBelutov

String Lenght 2

May 22nd, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Text.RegularExpressions;
  6. using System.Threading.Tasks;
  7.  
  8. namespace StringLenght
  9. {
  10.     class StringLenght
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             string text = Console.ReadLine();
  15.             var result = new StringBuilder();
  16.             if (text.Length<20)
  17.             {
  18.                 result.Append(text);
  19.                 for (int i = 0; i < 20-text.Length; i++)
  20.                 {
  21.                     result.Append("*");
  22.                 }
  23.                 Console.WriteLine(result);
  24.             }
  25.             else if (text.Length==20)
  26.             {
  27.                 Console.WriteLine(text);
  28.             }
  29.         }
  30.     }
  31. }
Add Comment
Please, Sign In to add comment