Advertisement
Guest User

Задание 4.8 Смирнов

a guest
Aug 14th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2.  
  3. namespace CSLight3
  4. {
  5.     internal class Program
  6.     {
  7.         private static void Main(string[] args)
  8.         {
  9.             Console.Write("Введите процент здоровья: ");
  10.             PaintHealthbar(int.Parse(Console.ReadLine()));
  11.             Console.WriteLine();
  12.         }
  13.  
  14.         private static void PaintHealthbar(int proc)
  15.         {
  16.             string healthbar = string.Empty;
  17.             healthbar = healthbar.PadLeft(proc / 10, '#').PadRight(10, '_');
  18.             Console.WriteLine("[{0}]", healthbar);
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement