当前位置:网站首页>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
边栏推荐
- Intranet penetration series: icmptunnel of Intranet tunnel (Master James Barlow's)
- Mobile terminal layout (3D conversion, animation)
- 【编程实践/嵌入式比赛】嵌入式比赛学习记录(一):TCP服务器和web界面的建立
- Introduction to sap query enhanced development
- 1216_MISRA_C规范学习笔记_控制流的规则要求
- 数据库之Mysql——概述安装篇
- Chapter V investment real estate
- Research on system and software security (5)
- BUUCTF MISC刷題
- CSV Column Extract列提取
猜你喜欢
随机推荐
vivo,硬件安全的爱与雷霆
数据库之MySQL——基础篇
【编程实践/嵌入式比赛】嵌入式比赛学习记录(二):基于TCP的图片流传输
攻防世界MISC刷题1-50
Cloud computing skills competition -- the first part of openstack private cloud environment
Go语学习笔记 - Slice、Map | 从零开始Go语言
Concours de compétences en informatique en nuage - - première partie de l'environnement cloud privé openstack
云计算技能大赛 -- openstack私有云环境 第二部分
Talk about the essence of interface idempotent and consumption idempotent
每周leetcode - 06 数组专题 7~739~50~offer 62~26~189~9
Ctf-misc summary
[problem solving] vs2019 solves the problem that the EXE file generated by compilation cannot be opened
雲計算技能大賽 -- openstack私有雲環境 第一部分
Ubuntu安装Mysql并查询平均成绩
1+x云计算中级--脚本搭建读写分离
Fibula dynamic programming
利用sqlmap注入获取网址管理员账号密码
Guoji Beisheng openstack container cloud environment construction
一篇文章看懂变量提升(hoisting)
Buuctf misc brush questions