Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [StartCode]
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp12
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int apple = 5;
- int maxApple = 10;
- drawBar(apple, maxApple);
- }
- static void drawBar(int amount, int maxAmount)
- {
- string bar = "";
- for (int i = 0; i < amount; i++)
- {
- bar += "#";
- }
- for(int i = amount; i < maxAmount; i++)
- {
- bar += "_";
- }
- Console.Write("[");
- Console.Write(bar);
- Console.WriteLine("]");
- }
- }
- }
- [EndCode]
Advertisement
Add Comment
Please, Sign In to add comment