Problem Description
Digital clock use 4 digits to express time, each digit is described by 3*3 characters (including”|”,”_”and” “).now given the current time, please tell us how can it be expressed by the digital clock.
Input
There are several test cases.
Each case contains 4 integers in a line, separated by space.
Proceed to the end of file.
Output
For each test case, output the time expressed by the digital clock such as Sample Output.
Sample Input
1 2 5 6
2 3 4 2
2 3 4 2
Sample Output
_ _ _
| _||_ |_
||_ _||_|
_ _ _
_| _||_| _|
|_ _| ||_
| _||_ |_
||_ _||_|
_ _ _
_| _||_| _|
|_ _| ||_
这道题很明显就是判断输入并输出,虽然简单,不过分类的时候的确令人头痛
代码:
#include <stdio.h>
int main()
{
int c[];
while(scanf("%d",&c[])!=EOF)
{
for(int i=;i<=;i++)
scanf("%d",&c[i]); for(int i=;i<=;i++)
if(c[i]==||c[i]==||c[i]==||c[i]==||c[i]==||c[i]==||c[i]==||c[i]==)
printf(" _ ");
else if(c[i]==||c[i]==)
printf(" ");
printf("\n"); for(int i=;i<=;i++)
if(c[i]==||c[i]==)
printf(" |");
else if(c[i]==||c[i]==)
printf(" _|");
else if(c[i]==||c[i]==||c[i]==)
printf("|_|");
else if(c[i]==||c[i]==)
printf("|_ ");
else if(c[i]==)
printf("| |");
printf("\n"); for(int i=;i<=;i++)
if(c[i]==||c[i]==||c[i]==)
printf(" |");
else if(c[i]==)
printf("|_ ");
else if(c[i]==||c[i]==||c[i]==)
printf(" _|");
else if(c[i]==||c[i]==||c[i]==)
printf("|_|");
printf("\n");
} return ;
}