Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct punkt
- {
- int x;
- int y;
- punkt * nastepny;
- };
- int main()
- {
- punkt * podstawa = new punkt;
- podstawa->x = 1;
- podstawa->y = 2;
- podstawa->nastepny = NULL;
- punkt * start = podstawa;
- for(int i=2; i<12; i++)
- {
- punkt * nowy = new punkt;
- podstawa->nastepny = nowy;
- nowy->x = i;
- nowy->y = i+1;
- nowy->nastepny = NULL;
- }
- while(start->nastepny)
- {
- cout<<"X: "<<start->x<<endl;
- cout<<"Y: "<<start->y<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement