Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. Console.WriteLine("RAJZOLJUNK TRIANGLÉT");
  2. Console.WriteLine("Mekkora legyen a téglalap alapja ?");
  3. int alap2 = int.Parse(Console.ReadLine());
  4. Console.WriteLine("Mekkora legyen a téglalap magassága ?");
  5. int magassag2 = int.Parse(Console.ReadLine());
  6. Console.WriteLine();
  7. Console.Clear();
  8. Console.ForegroundColor = ConsoleColor.Yellow;
  9. for (int k = 1; k <= alap2; k++)
  10. {
  11. for (int j = 1; j <= k; j++)
  12. {
  13. Console.Write("*");
  14. }
  15. Console.WriteLine();
  16. }
  17. for (int k = 1; k <= alap2; k++)
  18. {
  19. for (int j = 1; j <= alap2-k; j++)
  20. {
  21. Console.Write(" ");
  22. }
  23. for (int j = 1; j <= k; j++)
  24. {
  25. Console.Write("*");
  26. }
  27. Console.WriteLine();
  28. }
  29. Console.WriteLine("PITAGORASZI ÖSSZEFÜGGÉS A2+B2=C2 szóval a háromszög átfogója : {0}", (alap2 * alap2) + (magassag2 * magassag2));
  30. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement