poj1102
来源:互联网 发布:网络射击游戏大全 编辑:程序博客网 时间:2024/04/28 20:30
Description
Input
The input file will be terminated by a line containing two zeros. This line should not be processed.
Output
Output a blank line after each number. (You will find a sample of each digit in the sample output.)
Sample Input
2 123453 678900 0
Sample Output
-- -- -- | | | | | | | | | | | | -- -- -- -- | | | | | | | | | | -- -- -- --- --- --- --- --- | | | | | | | || | | | | | | || | | | | | | | --- --- --- | | | | | | | || | | | | | | || | | | | | | | --- --- --- ---
#include<stdio.h>
#include<string.h>
char str1[11]="- -- -----";
char str2[11]="| ||| ||";
char str3[11]="||||| |||";
char str4[11]=" ----- --";
char str5[11]="| | | | ";
char str6[11]="|| |||||||";
char str7[11]="- -- -- --";
int main()
{
int s;
char ch[20];
int L,i,j,k;
while(1)
{
scanf("%d %s",&s,ch);
if(s==0)break;
L=strlen(ch);
for(i=0;i<L;i++)
{//输出所有数字的笔画1
printf(" ");
for(j=0;j<s;j++)//一个笔画有s个字符组成
printf("%c",str1[ch[i]-'0']);
printf(" ");
printf(" ");
}
printf("\n");
for(i=0;i<s;i++)
{//笔画2和3
for(j=0;j<L;j++)
{
printf("%c",str2[ch[j]-'0']);
for(k=0;k<s;k++)
printf(" ");//笔画2和3之间的空格
printf("%c",str3[ch[j]-'0']);
printf(" ");//每个数字之间的空格
}
printf("\n");
}
for(i=0;i<L;i++)
{//笔画4
printf(" ");
for(j=0;j<s;j++)
printf("%c",str4[ch[i]-'0']);
printf(" ");
printf(" ");
}
printf("\n");
for(i=0;i<s;i++)
{//笔画5和6
for(j=0;j<L;j++)
{
printf("%c",str5[ch[j]-'0']);
for(k=0;k<s;k++)
printf(" ");
printf("%c",str6[ch[j]-'0']);
printf(" ");
}
printf("\n");
}
for(i=0;i<L;i++)
{
printf(" ");
for(j=0;j<s;j++)
printf("%c",str7[ch[i]-'0']);
printf(" ");
printf(" ");
}
printf("\n");
printf("\n");
}
return 0;
}
- POJ1102
- poj1102
- POJ1102-模拟
- poj1102解题报告
- poj1102 LC-Display
- LC-Display POJ1102
- poj1102 LC-Display
- poj1102——LC-Display
- poj1102数字打印,七段数字码
- POJ1102 LC-Display【打印图案】
- poj1102+每个数字有七笔画每行扫描+注意细节每个样例后要有两个回车
- 2011-7-31 9:55:10
- POJ3687 Labeling Balls(拓扑排序的应用)
- linux shell
- [连载] Socket 深度探究 4 PHP (三)
- Android---Activity生命周期状态
- poj1102
- Modification of Communications Resource Settings
- 了啊你的
- spring中的scope
- 关于配置文件的读取方式.
- Ruby之Hello World
- linux调试简介
- 转载 ,PHP与JAVA的区别
- 减少配置的方法