• HDU 4706 Children's Day (水题)


    Children's Day

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
    Total Submission(s): 158    Accepted Submission(s): 72


    Problem Description
    Today is Children's Day. Some children ask you to output a big letter 'N'. 'N' is constituted by two vertical linesand one diagonal. Each pixel of this letter is a character orderly. No tail blank is allowed.
    For example, this is a big 'N' start with 'a' and it's size is 3.

    a e
    bdf
    c g

    Your task is to write different 'N' from size 3 to size 10. The pixel character used is from 'a' to 'z' continuously and periodic('a' is reused after 'z').
     
    Input
    This problem has no input.
     
    Output
    Output different 'N' from size 3 to size 10. There is no blank line among output.
     
    Sample Output
    [pre] a e bdf c g h n i mo jl p k q ......... r j [/pre]
    Hint
    Not all the resultsare listed in the sample. There are just some lines. The ellipsis expresseswhat you should write.
     
    Source
     
    Recommend
    liuyiding
     

    今天比赛的水题。

    记录一发

     1 /* *******************************************
     2 Author       : kuangbin
     3 Created Time : 2013年09月08日 星期日 12时16分28秒
     4 File Name    : 1001.cpp
     5 ******************************************* */
     6 
     7 #include <stdio.h>
     8 #include <algorithm>
     9 #include <iostream>
    10 #include <string.h>
    11 #include <vector>
    12 #include <queue>
    13 #include <set>
    14 #include <map>
    15 #include <string>
    16 #include <math.h>
    17 #include <stdlib.h>
    18 #include <time.h>
    19 using namespace std;
    20 
    21 char str[100][100];
    22 int main()
    23 {
    24     //freopen("in.txt","r",stdin);
    25     //freopen("out.txt","w",stdout);
    26     int cnt = 0;
    27     for(int i = 3;i <= 10;i++)
    28     {
    29         for(int j = 0;j < i;j++)    
    30         {
    31             for(int k = 0;k < i;k++)
    32                 str[j][k] = ' ';
    33             str[j][i] = 0;
    34         }
    35         for(int j = 0;j < i;j++)
    36         {
    37             str[j][0] = 'a' + cnt;
    38             cnt = (cnt+1)%26;
    39         }
    40         for(int j = i-2;j > 0;j--)
    41         {
    42             str[j][i-1-j] = 'a' + cnt;
    43             cnt = (cnt+1)%26;
    44         }
    45         for(int j = 0;j < i;j++)
    46         {
    47             str[j][i-1] = 'a' + cnt;
    48             cnt = (cnt+1)%26;
    49         }
    50         for(int j = 0;j < i;j++)
    51             printf("%s
    ",str[j]);
    52     }
    53 
    54     return 0;
    55 }
  • 相关阅读:
    第一课:人人站安装与使用教程
    linux 多个python版本的切换
    参考文章
    windows下scrapy 的安装
    vi 使用入门
    linux 源码安装
    C语言—第二次作业
    C语言第0次作业
    c语言博客园作业03函数
    tomcat对于web.xml的securityconstraint使用的处理机制
  • 原文地址:https://www.cnblogs.com/kuangbin/p/3308682.html
Copyright © 2020-2023  润新知