不多说

/*
* 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 = ;
char graph[MAXN][MAXN]; int main() {
int n;
while (scanf("%d", &n) == ) {
memset(graph, ' ', sizeof(graph));
int w = * n + ;
int in = * n - ;
for (int i = ; i < w; i++) {
graph[i][] = '*';
graph[i][w - ] = '*';
graph[i][w] = ;
}
for (int j = ; j < w; j++) {
graph[][j] = '*';
graph[w - ][j] = '*';
}
for (int j = ; j < w - ; j++) {
graph[][j] = '*';
graph[w - ][j] = '*';
}
for (int i = ; i < w - ; i++) {
graph[i][] = '*';
graph[i][w - ] = '*';
}
for (int i = ; i < w; i++) {
printf("%s\n", graph[i]);
}
}
return ;
}

bjfu1287字符串输出的大水题的更多相关文章

  1. hdu 1228 A+B 字符串处理 超级大水题

    中文意思不解释. 很水,我本来想用switch处理字符串,然后编译不通过...原来switch只能处理整数型的啊,我都忘了. 然后就有了很挫的一大串if代码了... 代码: #include < ...

  2. 第三届山西省赛1004 一道大水题(scanf)

    一道大水题 时间限制: C/C++ 2000ms; Java 4000ms 内存限制: 65535KB 通过次数: 44 总提交次数: 1020 问题描述 Dr. Pan作为上兰帝国ACM的总负责人, ...

  3. PAT甲题题解-1101. Quick Sort (25)-大水题

    快速排序有一个特点,就是在排序过程中,我们会从序列找一个pivot,它前面的都小于它,它后面的都大于它.题目给你n个数的序列,让你找出适合这个序列的pivot有多少个并且输出来. 大水题,正循环和倒着 ...

  4. 【数据结构】 最小生成树(四)——利用kruskal算法搞定例题×3+变形+一道大水题

    在这一专辑(最小生成树)中的上一期讲到了prim算法,但是prim算法比较难懂,为了避免看不懂,就先用kruskal算法写题吧,下面将会将三道例题,加一道变形,以及一道大水题,水到不用高级数据结构,建 ...

  5. 大水题(water)

    题目描述dzy 定义一个 $n^2$ 位的数的生成矩阵 $A$ 为一个大小为 $n \times n$ 且 Aij 为这个数的第 $i \times n+j-n$ 位的矩阵.现在 dzy 有一个数 $ ...

  6. 批处理将字符串输出到Windows剪贴板

    批处理将字符串输出到Windows剪贴板 2016-06-30 23:29 339人阅读 评论(0) 收藏 举报 版权声明:作者:N3verL4nd 出处:http://blog.csdn.net/x ...

  7. 将filenames里的每个字符串输出到out文件对象中注意行首的缩进

    在Linux上用强大的shell脚本应该也可以完成,可是使用Windows的朋友呢?其实象这样一个简单任务用Python这个强大脚本语言只要几条语句就可以搞定了.个大家知道,要完成这样一个任务根本不用 ...

  8. 8 C#中的字符串输出

    我们在前面已经用Console.WriteLine("*********")往dos窗口中输出过字符串.我们还定义过字符串的变量. string words ="我喜欢D ...

  9. 《c程序设计语言》读书笔记--大于8 的字符串输出

    #include <stdio.h> #define MAXLINE 100 #define MAX 8 int getline(char line[],int maxline); voi ...

随机推荐

  1. Python ->> 第一个Python程序

    #coding:utf-8 #print 'input your name, please' #name = raw_input('请输入你的名字:'.decode('utf-8').encode(' ...

  2. ajax练习习题一弹窗查看

    显示页面 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...

  3. 【Cocos2d实例教程一】xcode5下Cocos2d环境的搭建

    (转载请注明出处:http://blog.csdn.net/buptgshengod) 第一步,现在要安装集成环境xcode5,安装xcode5需要系统至少是os x 10.8.5. 第二步,下载co ...

  4. 索引 split2

    当往一个已经满了的索引块中插入新的索引条目时,将发生索引块的split,在9i下,分两种不同的情况进行split: (1)如果插入的索引键值不是最大的,将发生50-50的split,也就是说有bloc ...

  5. python 内建函数 type() 和 isinstance() 介绍

    Python 不支持方法或函数重载, 因此你必须自己保证调用的就是你想要的函数或对象.一个名字里究竟保存的是什么?相当多,尤其是这是一个类型的名字时.确认接收到的类型对象的身份有很多时候都是很有用的. ...

  6. HeadFirst Jsp 07 (使用 jsp)

    Jsp 变成 Servlet, 容器会查看你的JSP, 把它转换成java源代码, 再编译成完整的Java servlet类. Jsp 不需要你的编译, 容器会自动替换成servlet. 在 jsp中 ...

  7. C# 类的访问修改符

    C#共有五种修饰符:public.private.protected.internal.protected internal. ◆public:公有,对所有类可见,不受任何限制 ◆protected: ...

  8. 自己实现字符串操作函数strlen(),strcat(),strcpy(),strcmp()

    1.strlen()函数是求解字符串的有效长度的 1)非递归实现 size_t my_strlen(const char *str) { assert(str != NULL);  //断言,保证指针 ...

  9. find命令下的atime,ctime,mtime

    Linux下的find命令在目录结构中搜索文件,并执行指定的操作.linux下的find命令提供了相当多的查找条件,功能很强大,由于find的功能很强大,所以他的选项也很多,今天我们来细说一下find ...

  10. (转) error: linker command failed with exit code 1 (use -v to see invocation)

    转自:http://blog.csdn.net/tiantian1980/article/details/9175777   像这样的一大堆,总体说编译链接时错误 /Users/zhangtianji ...