【11.5湖南长沙】Problem A. Welcome(水题,快速模拟出答案,学习思维)

Problem A. Welcome

 

Input file: Output file: Time limit: Memory limit:

stdin
stdout
1 second
128 megabytes

”How happy we are, To meet friends from afar!”

Welcome to Hunan University of Chinese Medicine!

Hope all of you can enjoy the competition ^ v ^

Now your task is to read an integer w and output the character painting of ”HNUCM”, there are w space(s) (space are represented by dot) between two letters. Please refer to the sample for the specific format.

Input

There are several test files and each contains one case. The input contains only 1 integer w (1 ≤ w ≤ 2018).

Output

The output has 5 lines, each line has 25+4w characters which only contains ’o’(lowercase letter ’o’) and ’.’(English period ’.’)

Example

stdin

stdout

1

o...o.o...o.o...o.ooooo.o...o
o...o.oo..o.o...o.o.....oo.oo
ooooo.o.o.o.o...o.o.....o.o.o
o...o.o..oo.o...o.o.....o...o
o...o.o...o.ooooo.ooooo.o...o

stdin

stdout

2

o...o..o...o..o...o..ooooo..o...o
o...o..oo..o..o...o..o......oo.oo
ooooo..o.o.o..o...o..o......o.o.o
o...o..o..oo..o...o..o......o...o
o...o..o...o..ooooo..ooooo..o...o

【题意】

HNUCM五个字母是不变的,通过输入的w改变中间的间隔的点数

【改进】

第一遍读题完,第一眼没看出来五行组合出来的是五个字母,我还以为是每一行的五个字符代表一个字母,读第二遍题目时才发现,看样例速度还是要加强;

在间隔处插入点,我刚开始想了个超级麻烦的办法,把每五个存起来,其实只要把全部的都存起来然后循环插入就好了,还好队友想的是对的;

【代码】

#include <stdio.h>
char a[5][100] = {
        "o   o.o   o.o   o.ooooo.o   o",
        "o   o.oo  o.o   o.o    .oo oo",
        "ooooo.o o o.o   o.o    .o o o",
        "o   o.o  oo.o   o.o    .o   o",
        "o   o.o   o.ooooo.ooooo.o   o"
};
int main()
{
    int w;
    scanf("%d",&w);
    for(int i = 0;i < 5;i++)
    {
        for(int j = 0 ; j < 29;j++)
        {
            if(a[i][j] == '.')
                for(int k = 0;k < w;k++)    putchar('.');
            else
                putchar(a[i][j] == ' ' ? '.':a[i][j]);
        }
        printf("\n");
    }
    
    return 0;
}

 

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值