Advertisement
Guest User

najrzadziej

a guest
Oct 19th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. void zadanie(){
  2.    
  3.    
  4.     int Tabl[10] = {1, 1, 2, 3, 3, 3, 4, 4, 5, 5};
  5.     int iloscMin = 999;
  6.     int liczba;
  7.    
  8.     for(int i=0; i<10; i++){
  9.         int ilosc = 0;
  10.         for(int j=0; j<10; j++){
  11.            
  12.             if(Tabl[i]==Tabl[j]){
  13.                 ilosc++;
  14.             }
  15.        
  16.         }
  17.         if (ilosc<iloscMin){
  18.             iloscMin = ilosc;
  19.             liczba = i;
  20.         }
  21.     }
  22.        
  23.     cout << Tabl[liczba];       //w tym wypadku 2
  24.    
  25. }
  26. main(){
  27.    
  28.     zadanie();
  29.    
  30.     return 0;
  31.    
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement