Advertisement
STANAANDREY

first rep let

Aug 26th, 2019
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. bool fol[26], ok = true;
  5.  
  6. int main()
  7. {
  8.     char c[100];
  9.     cin.getline(c,100);
  10.     for (int i = 0; c[i] && ok; i++)
  11.         if (!fol[c[i] - 'a'])
  12.             fol[c[i] - 'a'] = true;
  13.         else
  14.         {
  15.             cout<<c[i]<<endl;
  16.             ok = false;
  17.         }
  18.     if (ok)
  19.         cout<<"nici o litera nu se rep";
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement