Advertisement
Guest User

Untitled

a guest
May 14th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.        
  8.         string word = String.Empty;
  9.         for (int count = 1; count <= 4; count++)
  10.         {
  11.             string number = Console.ReadLine();
  12.            
  13.             if (4 - number.Length == 4)
  14.             {
  15.                 word += "0000 ";
  16.             }  
  17.             else if (4 - number.Length == 3)
  18.             {
  19.                 word += "000" + number + " ";
  20.             }  
  21.             else if (4 - number.Length == 2)
  22.             {
  23.                 word += "00" + number + " ";
  24.             }
  25.             else if (4 - number.Length == 1)
  26.             {
  27.                 word += "0" + number + " ";
  28.             }
  29.             else if (4 - number.Length == 0)
  30.             {
  31.                 word += number + " ";
  32.             }  
  33.         }
  34.         Console.WriteLine(word);
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement