zoukankan      html  css  js  c++  java
  • 【ACM】NYOJ_288_Time_20130725

    Time
    时间限制:1000 ms  |  内存限制:65535 KB
    难度:2
    描述
    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.


    Hint:


    The digits showed by the digital clock are as follows:
       _  _     _  _  _  _  _  _
     | _| _||_||_ |_   ||_||_|| |
     ||_  _|  | _||_|  ||_| _||_|
    输入
    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样例输出
        _  _  _
      | _||_ |_
      ||_  _||_|
     _  _     _
     _| _||_| _|
    |_  _|  ||_

    #include <stdio.h>
    int main()
    {int i,a[5];
        char s1[][5]={" _ ","   "," _ "," _ ","   "," _ "," _ "," _ "," _ "," _ "};
        char s2[][5]={"| |","  |"," _|"," _|","|_|","|_ ","|_ ","  |","|_|","|_|"};
        char s3[][5]={"|_|","  |","|_ "," _|","  |"," _|","|_|","  |","|_|"," _|"};   
        while(scanf("%d",&a[0])!=EOF)
        {
        for(i=1;i<4;i++)
        scanf("%d",&a[i]);
        for(i=0;i<4;i++)
        printf("%s",s1[a[i]]);
        printf(" ");
        for(i=0;i<4;i++)
        printf("%s",s2[a[i]]);
        printf(" ");
        for(i=0;i<4;i++)
        printf("%s",s3[a[i]]);
        printf(" ");
        }
        return 0;
    }

  • 相关阅读:
    软件架构感悟.
    浏览器缓存技术
    as到底干嘛了???
    关于WebForm开发问题(给新手的建议)
    疑难问题ASP.NET
    破解hash算法.高手请进,求解.
    (MVC和JVPL模式)Moon.Web架构谈
    Moon.NET框架架构及介绍
    调用API设置安卓手机的Access Point
    gtShell 为你常用的目录建立标签并快速跳转
  • 原文地址:https://www.cnblogs.com/xl1027515989/p/3217322.html
Copyright © 2011-2022 走看看