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:156 - Ananagrams

/*                 Author:MH RIYAD
                   LANGUAGE:C++
*/
#include<iostream>
#include<cstdio>
#include<string>
#include<map>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<vector>
#include<stack>
#define inf 100000000
#define pi acos(-1.0)
#define READ freopen("input.txt","r",stdin);
#define WRITE freopen ("out.txt","w",stdout);
#define maax 1000006
using namespace std;




int main()
{
    // READ
    char ss[500];
    map<string,string>mp;
    map<string,string>::iterator it;
    map<string,int>::iterator itt;
    map<string,int>mep;
    while(gets(ss))
    {
        if(ss[0]=='#')  break;
        char *ptr=strtok(ss," ");
        while(ptr!=NULL)
        {
            string s=ptr;
            string temp=s;
            for(int i=0; i<temp.size(); i++) temp[i]=tolower(temp[i]);
            sort(temp.begin(),temp.end());
            mep[temp]++;
            mp[s]= temp;
            ptr=strtok(NULL," ");
        }

    }


   

    for(it=mp.begin(); it!=mp.end(); it++)
    {
        string a=it->first;
        string b=it->second;
        if(mep[b]==1) cout<<a<<endl;

    }

    return 0;
}




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

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