1 2 5 6 2 3 4 2
_ _ _ | _||_ |_ ||_ _||_| _ _ _ _| _||_| _| |_ _| ||_
The digits showed by the digital clock are as follows: _ _ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_|| | ||_ _| | _||_| ||_| _||_|
辽宁省赛2010
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
const int maxn= 100000 + 10;
char s1[35]=" _ _ _ _ _ _ _ _ ";
char s2[35]=" | _| _||_||_ |_ ||_||_|| |";
char s3[35]=" ||_ _| | _||_| ||_| _||_|";
int main() {
int a,b,c,d;
while(~scanf("%d%d%d%d",&a,&b,&c,&d))
{
getchar();
if(a==0)
a=10;
if(b==0)
b=10;
if(c==0)
c=10;
if(d==0)
d=10;
printf("%c%c%c%c%c%c%c%c%c%c%c%c\n",s1[a*3-2],s1[a*3-1],s1[a*3],s1[b*3-2],s1[b*3-1],s1[b*3],s1[c*3-2],s1[c*3-1],s1[c*3],s1[d*3-2],s1[d*3-1],s1[d*3]);
printf("%c%c%c%c%c%c%c%c%c%c%c%c\n",s2[a*3-2],s2[a*3-1],s2[a*3],s2[b*3-2],s2[b*3-1],s2[b*3],s2[c*3-2],s2[c*3-1],s2[c*3],s2[d*3-2],s2[d*3-1],s2[d*3]);
printf("%c%c%c%c%c%c%c%c%c%c%c%c\n",s3[a*3-2],s3[a*3-1],s3[a*3],s3[b*3-2],s3[b*3-1],s3[b*3],s3[c*3-2],s3[c*3-1],s3[c*3],s3[d*3-2],s3[d*3-1],s3[d*3]);
}
return 0;
}
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
const int maxn= 100000 + 10;
char s[3][35]= {" _ _ _ _ _ _ _ _ ",
" | _| _||_||_ |_ ||_||_|| |",
" ||_ _| | _||_| ||_| _||_|"
};
int a[4];
int main() {
while(~scanf("%d",&a[0])) {
for(int i=1; i<4; i++)
scanf("%d",&a[i]);
for(int i=0; i<4; i++)
if(!a[i])
a[i]+=10;
for(int i=0; i<3; i++) {
for(int j=0; j<4; j++)
{
int t=a[j];
printf("%c%c%c",s[i][t*3-2],s[i][t*3-1],s[i][t*3]);
}
puts("");
}
}
return 0;
}
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
const int maxn= 100000 + 10;
char s[50][50];
int data[]={119,36,93,109,46,107,123,37,127,111};
int slove(int p,int x)
{
x=data[x];
if(x>>0&1)s[0][p+1]='_';
if(x>>1&1)s[1][p+0]='|';
if(x>>2&1)s[1][p+2]='|';
if(x>>3&1)s[1][p+1]='_';
if(x>>4&1)s[2][p+0]='|';
if(x>>5&1)s[2][p+2]='|';
if(x>>6&1)s[2][p+1]='_';
}
int main() {
int a[5];
while(~scanf("%d",&a[0])) {
for(int i=1; i<4; i++)
scanf("%d",&a[i]);
memset(s,' ',sizeof(s));
for(int i=0;i<3;i++)
s[i][12]=0;
for(int i=0;i<4;i++)
slove(i*3,a[i]);
for(int i=0;i<3;i++)
printf("%s\n",s[i]);
}
return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/zhang_xueping/article/details/47751293