Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*#include <iostream>
- using namespace std;
- struct cvor{
- int n;
- cvor *veza;
- };
- struct proizvod{
- string naziv;
- int sifra;
- double cijena;
- };
- void ispisiListu(cvor* lista)
- {
- cvor* tekuci;
- tekuci=lista;
- while (tekuci !=0){
- cout<<tekuci->n<<endl;
- tekuci=tekuci->veza;
- }
- }
- int main(){
- cvor* lista=NULL;
- int a;
- do{
- cout<<"upisi br ili 0 za kraj: ";
- cin>>a;
- cvor* novi= new cvor;
- novi->n=a;
- novi->veza=lista;
- lista=novi;
- }while(a!=0);
- ispisiListu(lista);
- return 0;
- }
- */
- #include <iostream>
- using namespace std;
- struct cvor{
- int n;
- cvor *veza;
- };
- void ispisiListu(cvor* lista)
- {
- cvor* tekuci;
- tekuci=lista;
- while (tekuci !=0){
- cout<<tekuci->n<<endl;
- tekuci=tekuci->veza;
- }
- }
- int main(){
- cvor* lista=NULL;
- int a;
- do{
- cout<<"upisi br ili 0 za kraj: ";
- cin>>a;
- *rep=
- cvor* novi= new cvor;
- novi->n=a;
- novi->veza=0;
- lista=novi;
- }while(a!=0);
- ispisiListu(lista);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement