knikolov98

Untitled

Oct 15th, 2019
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace coding
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string num = Console.ReadLine();
  10.             int length = num.Length;
  11.  
  12.             for (int i = length - 1; i >= 0; i--)
  13.             {
  14.  
  15.                 char currentChar = num[i];
  16.                 int currentInt = int.Parse(currentChar.ToString());
  17.  
  18.                 if (currentInt == 0)
  19.                 {
  20.                     Console.WriteLine("ZERO");
  21.                     continue;
  22.                 }
  23.  
  24.                 for (int j = 1; j <= currentInt; j++)
  25.                 {
  26.  
  27.                     Console.Write((char)(currentInt + 33));
  28.                 }
  29.                 Console.WriteLine();
  30.             }
  31.         }
  32.     }
  33. }
Add Comment
Please, Sign In to add comment