| ||||||||||
| 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 | |||||||||
贡献我的代码#include "cstdio"
char flag[10]={119,36,93,109,46,107,123,37,127,111};
void print(char *x,int s)
{
int i,j,k;
char temp;
for(j=0;x[j];j++)
{
if(flag[x[j]-'0']&1) temp='-';
else temp=' ';
putchar(' ');
for(k=1;k<=s;k++)
putchar(temp);
putchar(' ');
putchar(' ');
}
puts("");
for(i=1;i<=s;i++)
{
for(j=0;x[j];j++)
{
if(flag[x[j]-'0']&2) temp='|';
else temp=' ';
putchar(temp);
for(k=1;k<=s;k++)
putchar(' ');
if(flag[x[j]-'0']&4) temp='|';
else temp=' ';
putchar(temp);
putchar(' ');
}
puts("");
}
for(j=0;x[j];j++)
{
if(flag[x[j]-'0']&8) temp='-';
else temp=' ';
putchar(' ');
for(k=1;k<=s;k++)
putchar(temp);
putchar(' ');
putchar(' ');
}
puts("");
for(i=1;i<=s;i++)
{
for(j=0;x[j];j++)
{
if(flag[x[j]-'0']&16) temp='|';
else temp=' ';
putchar(temp);
for(k=1;k<=s;k++)
putchar(' ');
if(flag[x[j]-'0']&32) temp='|';
else temp=' ';
putchar(temp);
putchar(' ');
}
puts("");
}
for(j=0;x[j];j++)
{
if(flag[x[j]-'0']&64) temp='-';
else temp=' ';
putchar(' ');
for(k=1;k<=s;k++)
putchar(temp);
putchar(' ');
putchar(' ');
}
puts("");
}
int main()
{
int s;
char n[20];
while(scanf("%d%s",&s,n),n[0]!='0'||s)
{
print(n,s);
puts("");
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator