Advertisement
ge_or_gi

Untitled

Jan 31st, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace AddStarsIfNecesary
  8. {
  9. class AddStarsIfNecesary
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14.  
  15. Console.WriteLine("No More then 20 Symbols Please:");
  16.  
  17. string userInput = Console.ReadLine();
  18.  
  19. if (userInput.Length > 20)
  20. {
  21. Console.WriteLine("Cutting everyting over 20 :");
  22. Console.WriteLine(userInput.Remove(20));
  23. }
  24. if (userInput.Length == 20)
  25. {
  26. Console.WriteLine("Noting to Add");
  27. Console.WriteLine(userInput);
  28. }
  29. else
  30. {
  31. Console.WriteLine("Adding Stars to 20");
  32. Console.WriteLine(userInput.PadRight(20, '*'));
  33. }
  34.  
  35.  
  36.  
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement