Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. struct Punkt2D  {
  7.     int x;
  8.     int y;
  9. };
  10. int ile_punktow (){
  11.     cout<<"Podaj ile punktow chcesz wprowadzic 3/4";
  12.     int a;
  13.     cin>>a;
  14.     if (a==3) return 3;
  15.     else return 4;
  16. }
  17.  
  18.  
  19.  
  20. Punkt2D wczytywanie ()
  21.     {
  22.         Punkt2D tmp;
  23.         cout<<"Podaj x"endl;
  24.         cin>>tmp.x;
  25.         cout<< "Podaj y"<<endl;
  26.         cin>>tmp.y;
  27.         return tmp;
  28.     }
  29.     void sprawdzanie_poprawnosci (){
  30.        
  31.     }
  32. int main ()
  33. {
  34.     if (ile_punktow()==3)
  35.     {
  36.         Punkt2D tab[3];
  37.         for (int i=0; i<3; i++){
  38.             tab[i]=wczytywanie();
  39.         }
  40.     }
  41.     else{
  42.         Punkt2D tab[4];
  43.     for (int i=0; i<4; i++)
  44.         tab[i]=wczytywanie();
  45.     }
  46.     sprawdzanie_poprawnosci();
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement