kburnik

Zadatak Trener - honi-2013-2014-1

Sep 28th, 2013
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     Zadatak: Trener
  3.              http://bit.ly/honi-2013-2014-1
  4.  
  5.     Datum: 2013-09-28
  6.        
  7.     Autor zadatka: HSIN/HONI
  8.  
  9.     Autor rješenja: Kristijan Burnik, udruga informaticara Božo Težak
  10.  
  11.     Gmail: kristijanburnik
  12.  
  13. */
  14.  
  15. #include <iostream>
  16.  
  17. using namespace std;
  18.  
  19. int hist[256]={0};
  20.  
  21. int main() {
  22.    
  23.     int n;
  24.    
  25.     cin >> n;
  26.    
  27.     for (int i = 0 ; i < n; i++) {
  28.         string s;
  29.         cin >> s;
  30.         hist[ (int) s.c_str()[0] ]++;
  31.     }
  32.    
  33.    
  34.     bool found = false;
  35.     for (char c = 'a' ; c <= 'z'; c++) {
  36.         if ( hist[c] >= 5 ) {
  37.             found = true;
  38.             cout << c;
  39.         }
  40.     }
  41.    
  42.     if (!found)
  43.         cout << "PREDAJA";
  44.    
  45.    
  46.     cout << endl;
  47.     return 0;
  48. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×