電子鐘,電子錶

來源:互聯網
上載者:User

電子鐘,電子錶
1027:電子鐘分數: 10時間限制:1 秒記憶體限制:32 兆特殊判題: 否提交:17解決: 11標籤

  • 類比
題目描述

電子鐘用四個數字來表示時間,每個數位尺寸為3*3,用於表示數位字元包括‘|’、‘_’和空格。

現在給你當前的時間,請你告訴我們電子鐘是如何展示這個時間的。

電子鐘顯示的數字樣式如下:

    _  _     _  _  _  _  _  _   | _| _||_||_ |_   ||_||_|| |  ||_  _|  | _||_|  ||_| _||_|

輸入格式

輸入包含多組測試資料。每組輸入包含4個整數,表示目前時間。

輸出

對於每組輸入,輸出由電子鐘顯示出來的時間樣式。

範例輸入

1 2 5 6
2 3 4 2

範例輸出

    _  _  _ 
  | _||_ |_ 
  ||_  _||_|
 _  _     _ 
 _| _||_| _|

|_  _|  ||_ 




#include<stdio.h>int main(){int n[4],i;while(scanf("%d%d%d%d",&n[0],&n[1],&n[2],&n[3])!=EOF){for(i=0;i<4;i++){switch(n[i]){case 1:case 4://不能以為沒有就可以不輸出,要輸出空格!!! printf("   ") ;break;default:printf(" _ ") ;}}//第一排 printf("\n");for(i=0;i<4;i++){switch(n[i]){case 1:case 7:printf("  |");break;case 2:case 3:printf(" _|");break;case 4:case 8:case 9:printf("|_|");break;case 5:case 6:printf("|_ ");break;case 0:printf("| |");}}printf("\n");for(i=0;i<4;i++){switch(n[i]){case 1:case 4:case 7:printf("  |");break;case 2:printf("|_ ");break;case 3:case 5:case 9:printf(" _|");break;case 6:case 8:case 0:printf("|_|");break;}}printf("\n"); }} 


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.