A New Alphabet

 

Problem Link

Create an array to store the characters &store them

then take input if there is any uppercase ,change the character to lowercase then print the value

 

 

View Code
#include <bits/stdc++.h>
using namespace std;


int main()
{string s;
map<char,string>a;

a['a']="@";
a['b']="8";
a['c']="(";
a['d']="|)";
a['e']="3";
a['f']="#";
a['g']="6";
a['h']="[-]";
a['i']="|";
a['j']="_|";
a['k']="|<";
a['l']="1";


a['m']="[]\\/[]";
a['z']="2";
a['y']="`/";
a['x']="}{";
a['w']="\\/\\/";
a['v']="\\/";
a['u']="|_|";
a['t']="']['";
a['s']="$";
a['r']="|Z";
a['q']="(,)";
a['p']="|D";
a['o']="0";
a['n']="[]\\[]";

while(getline(cin,s)){
int l=s.size();
for(int i=0;i<l;i++)
{if(s[i]>='A' &&s[i]<='Z')
s[i]=s[i]+32;

if(a.count(s[i]))
cout<<a[s[i]];
else cout<<s[i];
}}
	return 0;
}

 

 

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s