Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace AddStarsIfNecesary
- {
- class AddStarsIfNecesary
- {
- static void Main(string[] args)
- {
- Console.WriteLine("No More then 20 Symbols Please:");
- string userInput = Console.ReadLine();
- if (userInput.Length > 20)
- {
- Console.WriteLine("Cutting everyting over 20 :");
- Console.WriteLine(userInput.Remove(20));
- }
- if (userInput.Length == 20)
- {
- Console.WriteLine("Noting to Add");
- Console.WriteLine(userInput);
- }
- else
- {
- Console.WriteLine("Adding Stars to 20");
- Console.WriteLine(userInput.PadRight(20, '*'));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement