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 :11541 Decoding solution

#include <iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>

using namespace std;

int main()
{
   // freopen("in.txt","r",stdin);
    int T,cas,l;
    char ary[1000];
    string str;
    char lastchar;
    scanf("%d",&T);
    for(cas=1; cas<=T; cas++)
    {
        cin>>str;
        int len=str.size();
        int k=0;
        printf("Case %d: ",cas);
        for(int i=0; i<len; i++)
        {
            if(str[i]>='A'&&str[i]<='Z')
            {
                if(i>0)
                {
                    ary[k++]='\0';
                    l=atoi(ary);
                    while(l--) cout<<lastchar;

                }

                lastchar=str[i];
                k=0;
            }
            else
            {
                ary[k++]=str[i];

            }
        }
        ary[k++]='\0';
        l=atoi(ary);
        while(l--) cout<<lastchar;
        cout<<endl;


    }

    return 0;
}

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

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