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 : 10815 - Andy's First Dictionary

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

using namespace std;
map<string,int>mep;
map<string,int>:: iterator it;
void stk(char *s)
{
    char *ptr=strtok(s," ");
    while(ptr!=NULL)
    {
        string p=ptr;
        if(mep[p]==0) mep[p]++;
        ptr=strtok(NULL," ");
    }
}

int main()
{
    char ss[300];
    char str[300];
    while(gets(ss))
    {
        if(ss[0]=='\0') continue;
        int l=strlen(ss);
        int j=0;
        for(int i=0; i<l; i++)
        {
            if(ss[i]>='A'&&ss[i]<='Z') ss[i]=tolower(ss[i]);
            if(!(ss[i]>='a'&&ss[i]<='z')||(ss[i]==' '))ss[i]=' ';
            str[j++]=ss[i];
        }
        str[j]='\0';
        stk(str);
    }

    for(it=mep.begin(); it!=mep.end(); it++) cout<<it->first<<endl;


    return 0;
}

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

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