#include<stdio.h>
#include<string.h>
int main()
{
int n,m,a[][];
while(scanf("%d%d",&n,&m)!=EOF)
{ int t,i,j;
t=a[i=][j=]=;
while(t<n*m)
{
while(j+<m)
a[i][++j]=++t;
a[++i][j]=++t;
while(j->=)
a[i][--j]=++t;
a[++i][j]=++t;
} for(int i=;i<n;i++)
{
for(int j=;j<m-;j++)
{
printf("%2d ",a[i][j]);
}
printf("%2d\n",a[i][m-]);
}
} return ;
}

Problem D: 零起点学算法95——弓型矩阵的更多相关文章

  1. 武汉科技大学ACM :1009: 零起点学算法63——弓型矩阵

    Problem Description 输出n*m的弓型矩阵 Input 多组测试数据 每组输入2个整数 n和m(不大于20) Output 输出n*m的弓型矩阵,要求左上角元素是1,(每个元素占2个 ...

  2. Problem D: 零起点学算法94——输出矩阵

    #include<stdio.h> int main() { ][]; while(scanf("%d %d",&n,&m)!=EOF) { ; ;i& ...

  3. Problem H: 零起点学算法109——单数变复数

    #include <stdio.h> #include<string.h> int main(void) { int n; ]; scanf("%d",&a ...

  4. Problem G: 零起点学算法106——首字母变大写

    #include<stdio.h> #include<string.h> int main(void) { ]; int i,k; while(gets(a)!=NULL) { ...

  5. Problem F: 零起点学算法42——多组测试数据输出II

    #include<stdio.h> int main() { ; while(scanf("%d%d%d",&a,&b,&c)!=EOF) { ...

  6. Problem E: 零起点学算法34——3n+1问题

    #include<stdio.h> #include<math.h> int main() { int n; n<=pow(,); ; scanf("%d&qu ...

  7. Problem K: 零起点学算法107——统计元音

    #include<stdio.h> int main() { int n; ]; while(scanf("%d%*c",&n)!=EOF) { while(n ...

  8. Problem J: 零起点学算法105——C语言合法标识符

    #include<stdio.h> #include<ctype.h>//调用isalpha函数 int main() { int n; ]; while(scanf(&quo ...

  9. Problem I: 零起点学算法104——Yes,I can!

    #include<stdio.h> int main() { ]; while(gets(a)!=NULL) { printf("I am "); printf(&qu ...

随机推荐

  1. PKUWC 2019 自闭记

    PKUWC 2019 自闭记 Day -1 考前天天在隔壁的物竞教室划水(雀魂,能和吉老师一起玩的游戏都是好游戏),没有做题. Day 0 早上8:16的高铁,到广州南居然要6个小时...不知道福州和 ...

  2. perl6中的hash定义(2)

    use v6; , :b, :!c; say %ha; say %ha<a>; #这里不能用%ha{a}, {a}表示调用a()函数了, 在perl6中, {}有特别函义 say %ha{ ...

  3. linux网络编程之IO函数

    Linux操作系统中的IO函数主要有read(),write(),recv(),send(),recvmsg(),sendmsg(),readv(),writev(). 接收数据的recv()函数 # ...

  4. HDU 5118 GRE Words Once More!

    题目链接:HDU-5118 题意:给定一个有向无环图,每条边有一个权值.标定一些特定节点为“特殊节点”.从节点1出发到某“特殊节点”结束的路径,称为一个“GRE单词”.单词由路径上的权值组成.给定一组 ...

  5. [How to] 使用Xib来创建view

    1.简介 代码库 正如之前博客介绍的,xib可定义页面的某个部分,特别当此部分区域的view集中并且还有一些相互关联性(如隐藏等)是i特别适合使用xib来进行封装. 本文为[How to]使用自定义c ...

  6. 阿里CDN核心技术解密

    1. 阿里CDN组件分层 其中应用层主要用到的技术有负载均衡和缓存, 负载均衡包括全局负载均衡和本地负载均衡; 缓存通过HTTP缓存服务器Swift做HTTP缓存. 全局负载均衡以DNS服务器Phar ...

  7. Linux Python apache的cgi配置

    一.找到安装Apache的目录/usr/local/apache2/conf,并对httpd.conf配置文件进行修改 1.加载cgi模块 去掉注释: LoadModule cgid_module m ...

  8. windows7配置python和django的开发环境

    直接上图,这是我在我的电脑配置windows7python和django开发环境的所有用到的软件 要求不高,只需要这几个软件的版本相一致就行, 需要注意的是软件安装时需要统一是32位或者64位的软件, ...

  9. QT中ui更改后不能更新的解决方法

    ui源文件到界面显示的原理可以网上搜索,这里不再描述.简单讲就是先要从*.ui生成ui_*.h然后再编译,所以界面未更新实际上是因为ui_*.h这个文件没有更新导致的. 出现此问题后我尝试了以下几个方 ...

  10. python import模块的搜索路径

    当在py代码中import所依赖的模块时, python是从哪里找到这些模块呢,即模块的搜索路径是啥? 默认情况下,Python解释器会搜索当前目录.所有已安装的内置模块和第三方模块,搜索路径存放在s ...