UVA Problem 11946 (Code Number Solution) Solution

Problem Solving, UVa

 

#include <bits/stdc++.h>

#include <string.h>

using namespace std;



int main()

{

int tc,i,j;

char s[100],l;

cin>>tc;



    getchar();

  for(i=1;i<=tc;i++)

  {

    while(gets(s)!='\0')

    {

        l=strlen(s);

        if(l==0)

        {

            break;

        }

        for(j=0;j<l;j++)

        {

            if(s[j]=='3') cout<<"E";

            else if (s[j]=='0') cout<<"O";

            else if (s[j]=='1') cout<<"I";

            else if (s[j]=='4') cout<<"A";

            else if (s[j]=='9') cout<<"P";

            else if (s[j]=='8') cout<<"B";

            else if (s[j]=='5') cout<<"S";

            else if (s[j]=='7') cout<<"T";

            else if (s[j]=='2') cout<<"Z";

            else if (s[j]=='6') cout<<"G";

            else

            cout<<s[j];

        }

       

        cout<<endl;

    }

    if(i != tc)

    {

        cout<<endl;

    }



}

return 0;

}

 

0 Comments

You may find interest following article

Complete Guide: Create Laravel Project in Docker Without Local Dependencies

Create Laravel Project Through Docker — No Need to Install PHP, MySQL, or Apache on Your Local Machine In this tutorial, I’ll show you how to create and run a full Laravel project using Docker containers. That means you won’t have to install PHP, MySQL, or Apache locally on your computer. By the end of this guide, you’ll have a fully functional Laravel development...