Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct punkt
  6. {
  7. int x,y;
  8. };
  9. punkt licz(punkt tab[], int n)
  10. {
  11. liczx=tab[0].x;
  12. liczy=tab[0].y;
  13. for (int i=0; i<n; i++)
  14. {
  15. if (liczx<tab[i].x)
  16. liczx=tab[i].x;
  17.  
  18. if (liczy>tab[i].y)
  19. liczy=tab[i]
  20. }
  21.  
  22. }
  23.  
  24. int main()
  25. {
  26. int n=0;
  27. cout<< "Podaj ilosc punktow: ";
  28. cin >> n;
  29. punkt *tab;
  30. tab = new punkt[n];
  31. for (int i =0; i<n; i++)
  32. {
  33. cout << "Podaj wspolrzedne x: "
  34. cin << tab[i].x
  35. cout << "Podaj wspolrzedne y: "
  36. cin << tab[i].y
  37. }
  38. delete[] tab;
  39.  
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement