plw的晚餐

版权声明:来自星空计算机团队(QQ群:134826825)——StarSky_STZG https://blog.csdn.net/weixin_43272781/article/details/86554528

http://murphyc.fun/contest/5/problem/L

Description

plw吃完午饭之后,马上又觉得肚子饿了。他决定马上从美食区离开,赶往下一个吃饭地点"香香鸡"。但是在plw离开离开美食区之前,需要按美食区的规矩画一个特殊符号,并且如果是这是第k次离开美食区,就需要画k倍大小的图形

无标题.png

Input

多组测试

第一行输入T (T <= 10)

接下来T行,每一行输入一个k(k<=1000),代表这是第k次离开美食区。

Output

对于每次输入要求输出k倍大小的标准图形。

每2组测试数据之间输出一个空行。

注意不要输出多余的空行或者行末空格。

Sample Input 1 

2
1
2

Sample Output 1

 ___
/   \
\___/
_| |_
|___|

  ______
 /      \
/        \
\        /
 \______/
  |    |
__|    |__
|        |
|________|

C++版本一

/*
*@Author:   STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q;
int ans,cnt,flag,temp;
int a[N];
char str;
int main()
{
#ifdef DEBUG
	freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
#endif

    while(~scanf("%d",&t))
    while(t--){
        scanf("%d",&n);
        for(int i=1;i<=n;i++)
            printf(" ");
        for(int i=1;i<=3*n;i++)
            printf("_");
            printf("\n");
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n-i;j++){
                printf(" ");
            }
            printf("/");
            for(int j=1;j<=2*(i-1)+3*n;j++){
                printf(" ");
            }
            printf("\\\n");
        }
        for(int i=1;i<=n;i++){
            for(int j=1;j<i;j++){
                printf(" ");
            }
            printf("\\");
            for(int j=1;j<=2*(n-i)+3*n;j++){
                if(i==n)
                printf("_");
                else
                printf(" ");
            }
            printf("/\n");
        }
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                if(i==n)
                printf("_");
                else
                printf(" ");
            }
            printf("|");
            for(int j=1;j<=3*n-2;j++){
                printf(" ");
            }
            printf("|");
            for(int j=1;j<=n;j++){
                if(i==n)
                printf("_");
            }
            printf("\n");
        }
        for(int i=1;i<=n;i++){

            printf("|");

            for(int j=1;j<=5*n-2;j++){
                if(i==n)
                printf("_");
                else
                printf(" ");
            }
            printf("|");
            printf("\n");
        }

        if(t)
            printf("\n");
    }


    //cout << "Hello world!" << endl;
    return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_43272781/article/details/86554528