SHARE
TWEET

02. Coding

t_sh0w Dec 15th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top