Advertisement
t_sh0w

02. Coding

Dec 15th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2.  
  3. namespace NestedLoopsExercise2Coding
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string inputNum = Console.ReadLine();
  10.  
  11.             for (int i = inputNum.Length - 1; i >= 0; i--)
  12.             {
  13.                 int currentDigitToNumber = int.Parse(inputNum[i].ToString());
  14.  
  15.                 if (currentDigitToNumber == 0) // 2nd
  16.                 {
  17.                     Console.WriteLine("ZERO");
  18.                     continue;
  19.                 }
  20.  
  21.                 for (int j = 1; j <= currentDigitToNumber; j++)
  22.                 {
  23.                     Console.Write((char)(currentDigitToNumber + 33)); // Write!
  24.                 }
  25.                 Console.WriteLine(); // всеки символ на нов ред
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement