Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- uint32_t zlicz_rozne(string t)
- {
- uint32_t wystepuje[26];
- for(int i=0; i<26; i++)
- wystepuje[i]=0;
- for(int i=0; i<t.length(); i++)
- wystepuje[(int)(t[i]-'A')]=1;
- uint32_t zlicz=0;
- for(int i=0; i<26; i++)
- if(wystepuje[i]==1)
- zlicz++;
- return zlicz;
- }
- int main()
- {
- string c;
- string p="";
- uint32_t maxi=0, z;
- for(int i=1; i<=1000; i++)
- {
- cin>>c;
- z = zlicz_rozne(c);
- if (z>maxi){
- maxi = z;
- p=c;
- }
- }
- cout << p << " " << maxi << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement