Advertisement
Josif_tepe

Untitled

Mar 19th, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int moneti[4];
  8.     int ednakvi_na_0 = 0;
  9.     int ednakvi_na_5 = 0;
  10.     for (int i = 0; i <= 3; i += 1)
  11.     {
  12.         cin >> moneti[i];
  13.         if (moneti[i] == 0)
  14.         {
  15.             ednakvi_na_0 += 1;
  16.         }
  17.         if (moneti[i] == 5)
  18.         {
  19.             ednakvi_na_5 += 1;
  20.         }
  21.     }
  22.     if ( ednakvi_na_0 < ednakvi_na_5)
  23.     {
  24.         cout << ednakvi_na_0 << endl;
  25.     }
  26.     else
  27.     {
  28.         cout << ednakvi_na_5 << endl;
  29.     }
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement