Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- while (true)
- {
- Console.WriteLine("Введите процент");
- int percent = Convert.ToInt32(Console.ReadLine());
- int number = Calculation(percent);
- Drawing(number);
- Console.ReadLine();
- Console.Clear();
- }
- }
- static int Calculation(int percent)
- {
- double onePartPercent = 0.09;
- int priorityPart = 0;
- int part = 0;
- return part = Convert.ToInt32(Math.Round(percent * onePartPercent));
- }
- static void DrawingBar(int number)
- {
- Console.Write("[");
- Console.BackgroundColor = ConsoleColor.Red;
- for(int i = 0; i < number; i++)
- {
- Console.Write('#');
- }
- Console.BackgroundColor = ConsoleColor.Black;
- for (int i = number; i < 9; i++)
- {
- Console.Write('_');
- }
- Console.Write("]");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement