Advertisement
Guest User

Untitled

a guest
May 21st, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. int main(){
  2.  
  3. char destinacija[20];
  4. int tip,cena,rastojanie,lugje;
  5. bool shofer;
  6. int n;
  7. cin>>n;
  8. Transport **ponudi;
  9. ponudi=new Transport *[n];
  10.  
  11. for (int i=0;i<n;i++){
  12.  
  13. cin>>tip>>destinacija>>cena>>rastojanie;
  14. if (tip==1) {
  15. cin>>shofer;
  16. ponudi[i]=new AvtomobilTransport(destinacija,cena,rastojanie,shofer);
  17.  
  18. }
  19. else {
  20. cin>>lugje;
  21. ponudi[i]=new KombeTransport(destinacija,cena,rastojanie,lugje);
  22. }
  23.  
  24.  
  25. }
  26.  
  27. AvtomobilTransport nov("Ohrid",2000,600,false);
  28. pecatiPoloshiPonudi(ponudi,n,nov);
  29.  
  30. for (int i=0;i<n;i++) delete ponudi[i];
  31. delete [] ponudi;
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement