| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
哦In Reply To:贡献我的代码 Posted by:seedeed at 2011-03-25 23:20:18 #include<iostream>
using namespace std;
char dis[10][15]={
' ','-',' ', '|',' ','|', ' ',' ',' ', '|',' ','|', ' ','-',' ', //0
' ',' ',' ', ' ',' ','|', ' ',' ',' ', ' ',' ','|', ' ',' ',' ', //1
' ','-',' ', ' ',' ','|', ' ','-',' ', '|',' ',' ', ' ','-',' ', //2
' ','-',' ', ' ',' ','|', ' ','-',' ', ' ',' ','|', ' ','-',' ', //3
' ',' ',' ', '|',' ','|', ' ','-',' ', ' ',' ','|', ' ',' ',' ', //4
' ','-',' ', '|',' ',' ', ' ','-',' ', ' ',' ','|', ' ','-',' ', //5
' ','-',' ', '|',' ',' ', ' ','-',' ', '|',' ','|', ' ','-',' ', //6
' ','-',' ', ' ',' ','|', ' ',' ',' ', ' ',' ','|', ' ',' ',' ', //7
' ','-',' ', '|',' ','|', ' ','-',' ', '|',' ','|', ' ','-',' ', //8
' ','-',' ', '|',' ','|', ' ','-',' ', ' ',' ','|', ' ','-',' ', //9
};
int n;
char m[10];
int siz;
void print(int line_num)
{
int p;
if((line_num/3)%2)p=n;
else p=1;
for(int t=0;t<p;t++)
{
for(int i=0;i<siz;i++)
{
printf("%c",dis[m[i]-'0'][line_num]);
for(int j=0;j<n;j++)
printf("%c",dis[m[i]-'0'][line_num+1]);
printf("%c",dis[m[i]-'0'][line_num+2]);
if(i!=siz-1)printf(" ");
else printf("\n");
}
}
}
int main()
{
while(scanf("%d%s",&n,m)&&n)
{
siz=strlen(m);
for(int i=0;i<5;i++)
print(i*3);
printf("\n");
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator