About Me

About Me : I have been working as a Software Engineer for various international companies for four years.Currently, I am working as a full stack Javascript developer in Petronas(Malaysia).

Skills

Skills • Javascript •Typescript •Python •C •Java •ReactJs • Redux • VueJs • NestJs • React Testing Library • Django• PostgreSQL • MySQL • NodeJs • Git • Docker • Jira • Visual Studio Code • Slack

শনিবার, ৩ জানুয়ারী, ২০১৫

Uva solution :755 - 487--3279

#include <iostream>
#include<cstdio>
#include<cstring>
#include<map>

using namespace std;
map<char,char>m;
void pre()
{
    m['A']='2';m['B']='2';m['C']='2';m['G']='4';m['H']='4';m['I']='4';
    m['J']='5';m['K']='5';m['L']='5';m['M']='6';m['N']='6';m['O']='6';
    m['P']='7';m['R']='7';m['S']='7';m['T']='8';m['U']='8';m['V']='8';
    m['W']='9';m['X']='9';m['Y']='9';
}

int main()
{
    pre();
    map<string,int>mep;
    map<string,int>::iterator it;
    int test,h;
    char ss[100];
    scanf("%d\n",&test);
    for(int cas=1; cas<=test; cas++)
    {

        scanf("%d",&h);
        getchar();
        while(h--)
        {
            gets(ss);
            int t=0;
            string str,res;
            int len=strlen(ss);
            for(int i=0; i<len; i++)
            {
                if(ss[i]!='-')
                {
                    ++t;
                    str+=ss[i];
                    if(t==3) str+='-';

                }
            }
            char p;
            for(int i=0; i<str.size(); i++)
            {
                if(str[i]>='A'&&str[i]<='Z')
                {
                    p=m[str[i]];

                }
                else p=str[i];
                res+=p;
            }
            mep[res]++;

        }

        bool flag=false;
        for(it=mep.begin(); it!=mep.end(); it++)
        {
            if((it->second)>1)
            {
                cout<<it->first<<" "<<it->second<<endl;
                flag=true;
            }
        }

        if(flag==false) printf("No duplicates.\n");
        mep.clear();

        if(cas!=test) printf("\n");
    }

    return 0;
}

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন