Each case contains 4 integers in a line, separated by space.
Proceed to the end of file.
1 2 5 6 2 3 4 2
_ _ _ | _||_ |_ ||_ _||_| _ _ _ _| _||_| _| |_ _| ||_
The digits showed by the digital clock are as follows: _ _ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_|| |||_ _| | _||_| ||_| _||_|
代码范例:
int main() { int a,b,c,d; string s[10]= {" _ "," "," _ "," _ "," "," _ "," _ "," _ "," _ "," _ "}; string t[10]= {"| |"," |"," _|"," _|","|_|","|_ ","|_ "," |","|_|","|_|"}; string w[10]= {"|_|"," |","|_ "," _|"," |"," _|","|_|"," |","|_|"," _|"}; while(cin>>a>>b>>c>>d) { cout<<s[a]<<s[b]<<s[c]<<s[d]<<endl; cout<<t[a]<<t[b]<<t[c]<<t[d]<<endl; cout<<w[a]<<w[b]<<w[c]<<w[d]<<endl; } return 0; }

本文介绍了一种使用3x3字符矩阵来表示数字的方法,并通过一个简单的C++程序演示了如何将四位数的时间显示为数字钟格式。每个数字由三行组成,每行四个字符,包括横线'_'、竖线'|'和空格。示例输入输出展示了如何用这种格式表示不同的时间。
1956

被折叠的 条评论
为什么被折叠?



