Advertisement
add1ctus

Роденденски прослави

Feb 20th, 2015
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     ios_base::sync_with_stdio(false);
  8.     int n;
  9.     cin>>n;
  10.     bool rodendeni[31][12]={{false}};
  11.     int brojac[12]={0};
  12.     int maks=0;
  13.  
  14.     for(int j=0;j<n;j++)
  15.     {
  16.         int temp,temp2;
  17.         cin>>temp>>temp2;
  18.         temp--;
  19.         temp2--;
  20.         if(!rodendeni[temp][temp2])
  21.             brojac[temp2]++;
  22.         rodendeni[temp][temp2]=true;
  23.     }
  24.  
  25.     for(int j=0;j<12;j++)
  26.         maks=max(maks,brojac[j]);
  27.  
  28.     for(int j=0;j<12;j++)
  29.         if(maks==brojac[j])
  30.             cout<<j+1<<endl;
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement