例如输入“HELLO”,输出
![](https://i-blog.csdnimg.cn/blog_migrate/f9ebfa78482cf16ac941b77d46226916.jpeg)
#include<stdio.h>
#include<string.h>
void judge(char **a,char ch){
switch(ch){
case 'H':{
char b[7][8]={"H H","H H","H H","HHHHHHH","H H","H H","H H"};
for(int i=0;i<7;i++){
for(int j=0;j<7;j++){
a[i][j]=b[i][j];
}
}
break;}
case 'E':{
char b[7][8]={"EEEEEEE","E ","E ","EEEEEEE","E ","E ","EEEEEEE"};
for(int i=0;i<7;i++){
for(int j=0;j<7;j++){
a[i][j]=b[i][j];
}}
break;}
case 'L':{
char b[7][8]={"L ","L ","L ","L ","L ","L ","LLLLLLL"};
for(int i=0;i<7;i++){
for(int j=0;j<7;j++){
a[i][j]=b[i][j];
}}
break;}
case 'O':{
char b[7][8]={"OOOOOOO","O O","O O","O O","O O","O O","OOOOOOO"};
for(int i=0;i<7;i++){
for(int j=0;j<7;j++){
a[i][j]=b[i][j];
}}
break;}
default:break;
}}
int main(){
char a[7][100];
char*p[7]={a[0],a[1],a[2],a[3],a[4],a[5],a[6]}; //定义指针数组
char m[10];
gets(m);
for(int i=0;i<strlen(m);i++){
judge(p,m[i]);
for(int i=0;i<7;i++){
p[i]=p[i]+7;
}}
for(int i=0;i<7;i++){
for(int j=0;j<35;j++){
printf("%c",a[i][j]);
if((j+1)%7==0)printf(" ");
}
printf("\n");
}
}