1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
#include <iostream>
#include <string>
using namespace std;
void printout ( string &sentence, const string letters[46][5]) {
int length=sentence.length();
int row=0;
int column=0;
int i=0;
char store_onechar_from_string;
for(column=0; column<5;column++) {
for (i=0;i<length;i++) {
store_onechar_from_string = sentence[i];
switch(store_onechar_from_string) {
case 'a':
cout<<letters[0][column];
if(i==length-1){
cout << endl;
}
break;
case 'A':
cout<<letters[0][column];
if(i==length-1){
cout << endl;
}
break;
case 'b':
cout<<letters[1][column];
if(i==length-1){
cout << endl;
}
break;
case 'B':
cout<<letters[1][column];
if(i==length-1){
cout << endl;
}
break;
default: cout << "Error";
}
}//switch
}
}//for column
int main() {
//Image of alphabets
const string letters[46][5]={
{
" ____ ", //00
" / _ \\ ", //01
" / /_\\ \\ ",
" / | \\ ",
" \\____|___/ "},
{
"_________ ",
"\\ __ \\ ",
" | |__| _/ ",
" | |__| \\ ",
"/________/ "},
};
string sentence;
cin>>sentence;
printout(sentence, letters);
cin.ignore(100, '\n');
cin.get();
return 0;
}
|