Wiktor123

7odwrócona

Jul 15th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _1zadanie
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string val;
  10. Console.Write("Wprowadź liczbę ");
  11. val = Console.ReadLine();
  12.  
  13. int x = Convert.ToInt32(val);
  14.  
  15. for (int i = 0; i<x; i++)
  16. {
  17. Console.Write("*");
  18.  
  19. }
  20.  
  21. for (int i = 0; i < x; i++)
  22. {
  23. Console.Write("\n");
  24. for (int j = 0; j <= i; j++)
  25. {
  26. if (i == j)
  27. {
  28. Console.Write("*");
  29. } else
  30. {
  31. Console.Write(" ");
  32. }
  33.  
  34. }
  35. }
  36. }
  37. }
  38. }
Add Comment
Please, Sign In to add comment