Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void zadanie(){
- int Tabl[10] = {1, 1, 2, 3, 3, 3, 4, 4, 5, 5};
- int iloscMin = 999;
- int liczba;
- for(int i=0; i<10; i++){
- int ilosc = 0;
- for(int j=0; j<10; j++){
- if(Tabl[i]==Tabl[j]){
- ilosc++;
- }
- }
- if (ilosc<iloscMin){
- iloscMin = ilosc;
- liczba = i;
- }
- }
- cout << Tabl[liczba]; //w tym wypadku 2
- }
- main(){
- zadanie();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement