Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct nyje
- {
- int data;
- nyje *next;
- };
- void Printo(nyje *first)
- {
- nyje *n = first;
- while (n!=NULL)
- {
- cout << "Adresa = " << n << endl;
- cout << "Data = " << n->data << endl;
- cout << "Pointeri = " << n->next<<endl;
- n = n->next;
- }
- }
- int main()
- {
- nyje *n , *first=NULL , *last=NULL;
- int vlera_nyjes , numri_nyjes,i;
- cout<<"Numri Nyjeveve : ";
- cin>>numri_nyjes;
- for (i=1;i<=numri_nyjes;i++)
- {
- n=new nyje;
- cout<<"Vlera ne nyjen e"<<i;
- cin>>vlera_nyjes;
- n->data=vlera_nyjes;
- n->next=NULL;
- if (first==NULL)
- {
- first =n;
- }
- else
- {
- last->next=n;
- }
- last=n;
- }
- Printo(first);
- cin.get();
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement