当前位置:网站首页>C outputs a two-dimensional array with the following characteristics.
C outputs a two-dimensional array with the following characteristics.
2022-04-23 08:09:00 【laocooon】
1 2 2 2 2 2 1
3 1 2 2 2 1 4
3 3 1 2 1 4 4
3 3 3 1 4 4 4
3 3 1 5 1 4 4
3 1 5 5 5 1 4
1 5 5 5 5 5 1
#include <stdio.h>
void main()
{
int a[7][7];
int i,j;
for (i=0;i<7;i++)
for (j=0;j<7;j++)
{
if (i==j||i+j==6) //i==j||i+j==6
a[i][j]=1;
else if (i<j&&i+j<6)
a[i][j]=2;//a[i][j]=2
else if (i>j&&i+j<6)
a[i][j]=3;
else if (i<j && i + j> 6 ) //i<j && i + j> 6
a[i][j]=4;
else
a[i][j]=5;
}
for (i=0;i<7;i++)
{
for (j=0;j<7;j++)
printf("%4d",a[i][j]);
printf("\n");//printf("\n");
}
}
版权声明
本文为[laocooon]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230638292776.html
边栏推荐
- 随笔(不定时更新)
- Smart business card applet business card details page function implementation key code
- Talk about the essence of interface idempotent and consumption idempotent
- MySQL -- the secret of lock -- how to lock data
- Attack and defense world misc questions 1-50
- Redis事务实现乐观锁原理
- Analysis of Nacos source code
- 一个没啥L用,但可以装X的IDEA插件
- Interview learning route
- 【无标题】
猜你喜欢

Attack and defense world misc questions 1-50
![[programming practice / embedded competition] learning record of embedded competition (I): establishment of TCP server and web interface](/img/f1/09de53509479a01098d3cf46bf48eb.jpg)
[programming practice / embedded competition] learning record of embedded competition (I): establishment of TCP server and web interface

分布式服务治理Nacos

Canvas learning Chapter 1

Concours de compétences en informatique en nuage - - première partie de l'environnement cloud privé openstack

Mysql database backup and recovery under Linux (full + incremental)

Cloud computing skills competition -- the first part of openstack private cloud environment

CSV Column Extract列提取

使用 Ingress 实现金丝雀发布

数据库之MySQL——基本常用查询命令
随机推荐
SAP self created table log function is enabled
Concours de compétences en informatique en nuage - - première partie de l'environnement cloud privé openstack
渗透测试面试合集---HVV---
strcat()、strcpy()、strcmp()、strlen()
Chapter V investment real estate
AAAI 2022招募讲者啦!!
Essays (updated from time to time)
Convert object to URL
3C装配中的机械臂运动规划
Buctf MISC brossage
Chapter VII asset impairment
几种智能机器人室内定位方法对比
输入 “ net start mysql ”,出现 “ 发生系统错误 5。 拒绝访问 ” 。问题详解
聊聊接口幂等与消费幂等的本质
[go]常见的并发模型[泛型版]
Alibaba sentinel学习QA
Intranet penetration series: pingtunnel of Intranet tunnel
Codeforces Round #784 (Div. 4)
Three minutes to teach you to use Houdini fluid > > to solve particle fluid droplets
从ES、MongoDB、Redis、RocketMQ出发谈分布式存储