Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. 27.
  2.  
  3. public static void Print(int n)
  4. {
  5. if (n == 1)
  6. Console.WriteLine("*");
  7. else
  8. {
  9. Print(n - 1);
  10. for (int i = 0; i < n; i++)
  11. {
  12. Console.Write("*");
  13. }
  14. Console.WriteLine();
  15. }
  16. }
  17.  
  18.  
  19.  
  20.  
  21.  
  22. 28.
  23. public static void Print(int n)
  24. {
  25. if (n == 1)
  26. Console.WriteLine("*");
  27. else
  28. {
  29. for (int i = 0; i < n; i++)
  30. {
  31. Console.Write("*");
  32. }
  33. Console.WriteLine();
  34. Print(n-1);
  35. for (int i = 0; i < n; i++)
  36. {
  37. Console.Write("*");
  38. }
  39. Console.WriteLine();
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement