Accepted solution

443A- Anton and Letters.

Open original problem
Source code

#include <iostream>

#include<vector>

#include<string>

#include<math.h>

/***** S. M. Sabiul Hajjaj Sabit *****/

using namespace std;

template <typename T>long long int power(T a, T b)

{

    long long int pow=1;

for(int i=0;i<b;i++)

    {

        pow *= a;

    }

    return pow;

}

int main()

{

   string s;

   int count=0;

   vector<int> alpha;

   for(int i=0;i<26;i++)

   {

       alpha.push_back(0);

   }

   getline(cin,s);

   for(int i=0;i<s.size();i++)

   {

       if(s[i]>='a' && s[i]<='z')

       {

           int t = s[i]-97;

           if(alpha[t]==0)

           {

               count++;

              /// cout<<s[i]<<endl;

               alpha[t]=1;

           }

       }

   }

   cout<<count<<endl;

}
Join the discussion

Add your comment