2018湖南省第14届大学生计算机程序设计竞赛 A字符画

Description

读入 w,请输出 2018 的字符画,两个数字之间有 w 个空格。具体格式请参考样例输出。

  • 1 ≤ w ≤ 2018

Input

输入文件只包含 1 个整数 w.

Output

输出 5 行,每行 12 + 3w 个字符(只包含 o 和 . 两种,字符画的部分用 o,空格的部分用 .),以换行符结尾。

Sample Input

2

Sample Output

ooo..ooo..ooo..ooo
..o..o.o...o...o.o
ooo..o.o...o...ooo
o....o.o...o...o.o
ooo..ooo..ooo..ooo

解释:这是一道水题,就是模拟,2018这个字符不变变化的只有中间的那个.的个数,所以直接写就行
#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <deque>
#include <list>
using namespace std;
typedef long long LL;
const int INF=0x3f3f3f3f;
const double eps=1e-8;
const double pi=acos(-1.0);
const int MOD=10056;
const int maxn=2016;
int w;

int main()
{
    scanf("%d",&w);
    for(int i=1;i<=5;i++)
    {
        if(i==1)
        {
            printf("ooo");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("ooo");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("ooo");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("ooo");
        }
        else if(i==2)
        {
            printf("..o");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("o.o");
            for(int j=1;j<=w;j++)
                printf(".");
            printf(".o.");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("o.o");
        }
        else if(i==3)
        {
            printf("ooo");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("o.o");
            for(int j=1;j<=w;j++)
                printf(".");
            printf(".o.");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("ooo");
        }
        else if(i==4)
        {
            printf("o..");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("o.o");
            for(int j=1;j<=w;j++)
                printf(".");
            printf(".o.");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("o.o");
        }
        else
        {
            printf("ooo");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("ooo");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("ooo");
            for(int j=1;j<=w;j++)
                printf(".");
            printf("ooo");
        }
        printf("\n");
    }
    return 0;
}

/**********************************************************************
    Problem: 1358
    User: HNCPCteam001
    Language: C++
    Result: AC
    Time:0 ms
    Memory:2024 kb
**********************************************************************/

 

转载于:https://www.cnblogs.com/jkzr/p/9589255.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值