Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct SLista
- {
- int dane;
- SLista *next;
- };
- int main()
- {
- SLista *akt, *glowa, *ogon;
- int liczba;
- akt=NULL;
- glowa=NULL;
- cout<<"Wprowadz calkowite liczby, 0 konczy wpisywanie"<<endl;
- cin>>liczba;
- while(liczba!=0)
- {
- ogon=akt;
- akt=new SLista;
- akt->dane=liczba;
- akt->next=NULL;
- if(ogon==NULL)
- {
- glowa=akt;
- }
- else
- {
- ogon->next=akt;
- }
- cin>>liczba;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement