Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- struct Punkt2D {
- int x;
- int y;
- };
- int ile_punktow (){
- cout<<"Podaj ile punktow chcesz wprowadzic 3/4";
- int a;
- cin>>a;
- if (a==3) return 3;
- else return 4;
- }
- Punkt2D wczytywanie ()
- {
- Punkt2D tmp;
- cout<<"Podaj x"endl;
- cin>>tmp.x;
- cout<< "Podaj y"<<endl;
- cin>>tmp.y;
- return tmp;
- }
- void sprawdzanie_poprawnosci (){
- }
- int main ()
- {
- if (ile_punktow()==3)
- {
- Punkt2D tab[3];
- for (int i=0; i<3; i++){
- tab[i]=wczytywanie();
- }
- }
- else{
- Punkt2D tab[4];
- for (int i=0; i<4; i++)
- tab[i]=wczytywanie();
- }
- sprawdzanie_poprawnosci();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement