Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Ex4._2
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Введите количество процентов: ");
- int temp = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine($"{temp}%");
- PrintHealthBar(temp);
- }
- static void PrintHealthBar(int procent)
- {
- Console.Write("[");
- int position = Convert.ToInt32(procent / 10.0);
- for (int i = 0; i < 10; i++)
- {
- if (i < position)
- Console.Write("#");
- else
- Console.Write("_");
- }
- Console.WriteLine("]");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement