HZNUOJ 2689 阅兵

Input

第一行给出一个正整数T,代表接下来会有T组输入。

紧接着给出T行,每行有一个正整数n(2≤n≤100)

Output

请观察样例,画出大小为n的飞机,每两组样例之间有一个空行,行末没有多余空格,也没有多余空行。

 解题思路:水题,有耐心就行,无聊的时候可以画个飞机玩一玩xD

ac代码:

#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        int m = n;
        int a = 4 * n - 1;
        int b = n - 2;
        int u = 0;
        int o = 2 * n - 1;
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= o; j++) {
                cout << ' ';
            }
            if (i == 1) cout << '*' << endl;
            else {
                cout << '*';
                for (int y = 1; y <= u; y++) cout << ' ';
                cout << '*' << endl;
            }
            if (i != n) u = 2 * i - 1;
            o--;
        }
        for (int i = 1; i <= n + 1; i++) {
            cout << '*';
        }
        for (int i = 1; i <= u; i++) cout << ' ';
        for (int i = 1; i <= n + 1; i++) {
            cout << '*';
        }
        cout << endl;
        for (int k=1;k<=b;k++){
        cout << '*';
        for (int i = 1; i <= u + 2 * n; i++) cout << ' ';
        cout << '*' << endl;
    }
        for (int i=1;i<=n+1;i++)
        {
            cout << '*';
        }
        for (int i=1;i<=u;i++) cout << ' ';
        for (int i=1;i<=n+1;i++)
        {
            cout << '*';
        }cout << endl;
        for (int i=1;i<=n;i++)
        {
            if(i!=n)
            {
                for (int j=1;j<=n;j++) cout << ' ';
                cout << '*';
                for (int j=1;j<=u;j++) cout << ' ';
                cout << '*' << endl;
            } else
            {
                for (int j=1;j<=n;j++) cout << ' ';
                for (int j=1;j<=u+2;j++) cout << '*';
            }
        }
        cout << endl << endl;
    }
    return 0;
}

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是一份简单的关于国庆的HTML页面代码: ```html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>国庆节</title> <style type="text/css"> body { background-color: #F5F5F5; font-family: Arial, sans-serif; } h1 { text-align: center; margin-top: 50px; } .container { margin: 50px auto; width: 80%; display: flex; flex-wrap: wrap; justify-content: center; } .card { background-color: white; border-radius: 5px; box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3); margin: 20px; padding: 20px; width: 300px; text-align: center; } .card img { width: 200px; height: 200px; border-radius: 50%; margin-bottom: 20px; } .card h2 { font-size: 24px; margin-bottom: 10px; } .card p { font-size: 16px; line-height: 1.5; } </style> </head> <body> <h1>庆祝中华人民共和国成立70周年</h1> <div class="container"> <div class="card"> <img src="https://picsum.photos/id/1011/200/200" alt="国庆节图片"> <h2>国庆节</h2> <p>国庆节,是中华人民共和国的一项重要节日。每年的10月1日,是中华人民共和国的国庆日,也是中国人民的共同节日。</p> </div> <div class="card"> <img src="https://picsum.photos/id/1025/200/200" alt="国庆节图片"> <h2>阅兵式</h2> <p>每年国庆节,中国都会举盛大的阅兵式,展示国家的军事实力和发展成就。</p> </div> <div class="card"> <img src="https://picsum.photos/id/1047/200/200" alt="国庆节图片"> <h2>升旗仪式</h2> <p>升旗仪式是国庆节的一项重要活动,通常在天安门广场举。升旗仪式上,人民群众高唱国歌,表达对祖国的热爱之情。</p> </div> </div> </body> </html> ``` 这个页面包括了一个标题、一个简单的介绍以及三个卡片,每个卡片都有一张图片、一个标题和一段简介。这些元素都使用CSS进样式设计,使得页面看起来更加美观。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值