serbiankiller's Armatar

serbiankiller

  • Member since: 3/15/2011
  • Gender: Male
 
 

About

Niz& Niz:perator+=(int br) { if(kap == duz) { Niz niz(duz + kor); for(int i = 0; i < duz; i++) { niz.niz[i]=niz[i]; } niz.niz[kap++] = br; brisi(); kopiraj(niz); } niz[duz++] = br; return *this; } int& operator[](int ind){ if((ind <= 0) || (ind > duz)) { exit(1); } return niz[ind]; } const int& operator[](int ind)const{ if((ind <= 0) || (ind > duz)) { exit(1); } return niz[ind]; } class URNiz : public Niz { ublic: explicit URNiz(int kap = 10, int kor = 4) : Niz(kap,kor) {} URNiz(const URNiz& n) { kopiraj(n); } ~URNiz() { brisi(); } URNiz& operator=(const URNiz& n){ if(this != &n) { brisi(); kopiraj(n); } return *this; } virtual URNiz& operator+=(int br); virtual void pisi(ostream& d) const; }; -------------urniz.cpp URNiz& URNiz:perator+=(int br) { if(kap == duz) { URNiz niz(duz + kor); for(int i = 0; i < duz; i++) { niz.niz[i]=niz[i]; } niz.niz[kap++] = br; brisi(); kopiraj(niz); } if (duz == 0) { niz[duz++] = br; } else { int i = 0; for (i = duz; i > 0; i--) { if (niz[i - 1] < br) { niz[i] = br; i = -1; } else { niz[i] = niz[i - 1]; } } if (i == 0) { niz[0] = br; } duz++; } return *this; } void URNiz:isi(ostream& d) const { d << '('; for(int i = 0; i < duz; i++) { d << (*this)[i] << ','; } d << '; } ----skup Skup& Skup:perator+=(int br) { if (!((*this) % br)) { if(kap == duz) { Skup niz(duz + kor); for(int i = 0; i < duz; i++) { niz.niz[i]=niz[i]; } niz.niz[kap++] = br; brisi(); kopiraj(niz); } niz[duz++] = br; } return *this; }

83Games Rated 220Comments 0Likes 1Forum Posts 0Games Submitted 0Merits

serbiankiller's Quests (8)

Show All Quests

The Messenger

Rules and Guidelines

Friends

All friends »