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 : 11988 - Broken Keyboard (a.k.a. Beiju Text)

#include<cstdio>
#include<cstring>
#include<list>
#include<iostream>
#define READ freopen("in.txt","r",stdin);
using namespace std;

int main()
{
   // READ
    list<char>l;
    list<char>::iterator it;
    string ss;
    while(cin>>ss)
    {
        it=l.begin();
        for(int i=0; i<ss.size(); i++)
        {

            if(ss[i]=='[') it=l.begin();
            else if(ss[i]==']') it=l.end();
            else l.insert(it,ss[i]);

        }

        for(it=l.begin(); it!=l.end(); it++) cout<<*it;
        printf("\n");
        l.clear();

    }

    return 0;
}

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

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