Guest User

03. Coding

a guest
Jun 9th, 2019
555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03._Coding
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string number = Console.ReadLine();
  10.  
  11.             int numberOfDigits = number.Length;
  12.             int newNumber = int.Parse(number);
  13.  
  14.             int counter = 1;
  15.  
  16.            
  17.             for (int i = 1; i <= numberOfDigits; i++)
  18.             {
  19.                 int length = newNumber / counter % 10;
  20.                
  21.                 if (i >1)
  22.                 {
  23.                     counter *= 10;
  24.                     length = newNumber / counter % 10;
  25.  
  26.                     if (length == 0)
  27.                     {
  28.                         Console.WriteLine("ZERO");
  29.                     }
  30.                 }
  31.  
  32.              
  33.                 for (int j = 1; j <= length; j++)
  34.                 {
  35.                    
  36.                     int convert = length + 33;
  37.  
  38.                     Console.Write((char)convert);
  39.                 }
  40.  
  41.                 if(length != 0)
  42.                 {
  43.                     Console.WriteLine("");
  44.  
  45.                 }
  46.                
  47.                 length = 0;
  48.  
  49.  
  50.             }
  51.  
  52.  
  53.  
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment