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.
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.
There are several test cases.
Each case contains 4 integers in a line, separated by space.
Proceed to the end of file.
For each test case, output the time expressed by the digital clock such as Sample Output.
1 2 5 6 2 3 4 2
_ _ _ | _||_ |_ ||_ _||_| _ _ _ _| _||_| _| |_ _| ||_
The digits showed by the digital clock are as follows: _ _ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_|| | ||_ _| | _||_| ||_| _||_|
#include <cstdio> #include <iostream> using namespace std; typedef long long ll; char pic[5][5]; void prin(int line,int a) { switch(a) { case 0:{ pic[0][0]=' ',pic[0][1]='_',pic[0][2]=' '; pic[1][0]='|',pic[1][1]=' ',pic[1][2]='|'; pic[2][0]='|',pic[2][1]='_',pic[2][2]='|'; break; } case 1:{ pic[0][0]=' ',pic[0][1]=' ',pic[0][2]=' '; pic[1][0]=' ',pic[1][1]=' ',pic[1][2]='|'; pic[2][0]=' ',pic[2][1]=' ',pic[2][2]='|'; break; } case 2:{ pic[0][0]=' ',pic[0][1]='_',pic[0][2]=' '; pic[1][0]=' ',pic[1][1]='_',pic[1][2]='|'; pic[2][0]='|',pic[2][1]='_',pic[2][2]=' '; break; } case 3:{ pic[0][0]=' ',pic[0][1]='_',pic[0][2]=' '; pic[1][0]=' ',pic[1][1]='_',pic[1][2]='|'; pic[2][0]=' ',pic[2][1]='_',pic[2][2]='|'; break; } case 4:{ pic[0][0]=' ',pic[0][1]=' ',pic[0][2]=' '; pic[1][0]='|',pic[1][1]='_',pic[1][2]='|'; pic[2][0]=' ',pic[2][1]=' ',pic[2][2]='|'; break; } case 5:{ pic[0][0]=' ',pic[0][1]='_',pic[0][2]=' '; pic[1][0]='|',pic[1][1]='_',pic[1][2]=' '; pic[2][0]=' ',pic[2][1]='_',pic[2][2]='|'; break; } case 6:{ pic[0][0]=' ',pic[0][1]='_',pic[0][2]=' '; pic[1][0]='|',pic[1][1]='_',pic[1][2]=' '; pic[2][0]='|',pic[2][1]='_',pic[2][2]='|'; break; } case 7:{ pic[0][0]=' ',pic[0][1]='_',pic[0][2]=' '; pic[1][0]=' ',pic[1][1]=' ',pic[1][2]='|'; pic[2][0]=' ',pic[2][1]=' ',pic[2][2]='|'; break; } case 8:{ pic[0][0]=' ',pic[0][1]='_',pic[0][2]=' '; pic[1][0]='|',pic[1][1]='_',pic[1][2]='|'; pic[2][0]='|',pic[2][1]='_',pic[2][2]='|'; break; } case 9:{ pic[0][0]=' ',pic[0][1]='_',pic[0][2]=' '; pic[1][0]='|',pic[1][1]='_',pic[1][2]='|'; pic[2][0]=' ',pic[2][1]='_',pic[2][2]='|'; break; } } for(int i=0;i<3;i++) cout<<pic[line][i]; } int main(void) { int a,b,c,d; while(cin>>a>>b>>c>>d) { int lin=0; while(lin!=3) { prin(lin,a); prin(lin,b); prin(lin,c); prin(lin,d); lin++; printf("\n"); } } }