zoukankan      html  css  js  c++  java
  • bjfu1287字符串输出的大水题

    不多说

    /*
     * Author    : ben
     */
    #include <cstdio>
    #include <cstdlib>
    #include <cstring>
    #include <cmath>
    #include <ctime>
    #include <iostream>
    #include <algorithm>
    #include <queue>
    #include <set>
    #include <map>
    #include <stack>
    #include <string>
    #include <vector>
    #include <deque>
    #include <list>
    #include <functional>
    #include <numeric>
    #include <cctype>
    using namespace std;
    const int MAXN = 90;
    char graph[MAXN][MAXN];
    
    int main() {
        int n;
        while (scanf("%d", &n) == 1) {
            memset(graph, ' ', sizeof(graph));
            int w = 2 * n + 1;
            int in = 2 * n - 3;
            for (int i = 0; i < w; i++) {
                graph[i][0] = '*';
                graph[i][w - 1] = '*';
                graph[i][w] = 0;
            }
            for (int j = 0; j < w; j++) {
                graph[0][j] = '*';
                graph[w - 1][j] = '*';
            }
            for (int j = 2; j < w - 2; j++) {
                graph[2][j] = '*';
                graph[w - 3][j] = '*';
            }
            for (int i = 2; i < w - 2; i++) {
                graph[i][2] = '*';
                graph[i][w - 3] = '*';
            }
            for (int i = 0; i < w; i++) {
                printf("%s
    ", graph[i]);
            }
        }
        return 0;
    }
  • 相关阅读:
    C#类型转换
    C#运算符
    SQL视图与触发器
    存储过程
    SQL 变量
    SQL 经典练习题
    字符串函数,数据类型转换,链接查询,纵向查询
    常用的 SQL 函数
    习题整理(1)
    子查询的部分内容
  • 原文地址:https://www.cnblogs.com/moonbay/p/4279610.html
Copyright © 2011-2022 走看看