Advertisement
bullit3189

Coding Nested Loops

Oct 31st, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7. int n = int.Parse(Console.ReadLine());
  8.  
  9. string strN = n.ToString();
  10.  
  11.  
  12.  
  13. for (int i=0; i<strN.Length; i++)
  14. {
  15. int number = n%10;
  16. int lastDigit = n/10;
  17. n=lastDigit;
  18.  
  19. if (number==0)
  20. {
  21. Console.Write("ZERO");
  22. }
  23. for (int z=0; z<number; z++)
  24. {
  25. int ascii = number +33;
  26. char symbol = (char) ascii;
  27. Console.Write(symbol);
  28. }
  29. Console.WriteLine();
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement