Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.70 KB | None | 0 0
  1. int main()
  2. {
  3.   int max_psow = 7;
  4.  
  5.   Pies *list[max_psow];
  6.  
  7.   for(int i = 0; i <= max_psow; i++)
  8.   {
  9.        list[i] = new Pies(ITEKST[i], 3*(10+i%6-1), 0);
  10.   }    
  11.  
  12.   cout << "Ilosc " << Pies::ilosc << " psow zgloszonych\n";
  13.  
  14.   cout << "Nr imie wys\n----------\n";
  15.  
  16.   for(int i = 0; i <= max_psow; i++)
  17.   {
  18.        cout << list[i]->nr_start << " " << list[i]->daj_imie() << " " << list[i]->daj_wys() << "\n";
  19.   }  
  20.   cout << "\n";
  21.   int nrst = 100;
  22.   for(int i = 0; i <= max_psow; i++)
  23.   {
  24.         if(list[i]->daj_wys() > 35)
  25.         {
  26.             cout << "niezakwalifikowany " << list[i]->daj_imie() << " wys. " << list[i]->daj_wys() << " > 35cm\n";
  27.             delete list[i];
  28.             list[i] = NULL;
  29.            
  30.         }    
  31.         else
  32.         {
  33.             list[i]->nr_start = nrst;
  34.             nrst++;  
  35.         }    
  36.   }    
  37.   cout << "\n";
  38.  
  39.   cout << "Ilosc " << Pies::ilosc << " psow zakwalifikowanych\n";
  40.  
  41.   cout << "Nr imie wys\n----------\n";
  42.  
  43.   for(int i = 0; i <= max_psow; i++)
  44.   {
  45.       if(list[i] == NULL) continue;
  46.        cout << list[i]->nr_start << " " << list[i]->daj_imie() << " " << list[i]->daj_wys() << "\n";
  47.   }  
  48.  
  49.   cout << "\n";
  50.  
  51.   for(int i = 0; i <= max_psow; i++)
  52.   {
  53.       if(list[i] == NULL)
  54.       {
  55.           list[i] = new Pies("Spozniak", 32, nrst);
  56.         break;  
  57.       }    
  58.   }  
  59.  
  60.   cout << "Ilosc " << Pies::ilosc << " psow zakwalifikowanych\n";
  61.  
  62.   cout << "Nr imie wys\n----------\n";
  63.  
  64.   for(int i = 0; i <= max_psow; i++)
  65.   {
  66.       if(list[i] == NULL) continue;
  67.        cout << list[i]->nr_start << " " << list[i]->daj_imie() << " " << list[i]->daj_wys() << "\n";
  68.   }  
  69.  
  70.   stop();
  71.   return 0;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement