当前位置:网站首页>C 输出一种二维数组,特点如下。
C 输出一种二维数组,特点如下。
2022-04-23 06:38: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://laocooon.blog.csdn.net/article/details/124355726
边栏推荐
- 内网渗透系列:内网隧道之icmptunnel(DhavalKapil师傅的)
- CTF-MISC学习之从开始到放弃
- Research on software security based on NLP (2)
- Houdini fluid > > particle fluid export to unity note
- Attack and defense world misc questions 1-50
- Ribbon启动流程
- Reading notes
- VBA调用SAP RFC实现数据读取&写入
- Intranet penetration series: ICMP of Intranet tunnel_ Tran
- strcat()、strcpy()、strcmp()、strlen()
猜你喜欢
云计算技能大赛 -- openstack私有云环境 第一部分
Intranet penetration series: icmptunnel of Intranet tunnel (by master dhavalkapil)
Research on software security based on NLP (2)
Export all SVG files in the specified path into pictures in PNG format (thumbnail or original size)
国基北盛-openstack-容器云-环境搭建
内网渗透系列:内网隧道之dns2tcp
Teach-Repeat-Replan: A Complete and Robust System for Aggressive Flight in Complex Environments
DVWA靶场练习
Go语学习笔记 - Slice、Map | 从零开始Go语言
攻防世界MISC刷题1-50
随机推荐
SAP sto with billing process and configuration
[NLP notes] preliminary study on CRF principle
Chapter VII asset impairment
Using lambda expression to solve the problem of C file name sorting (whether it is 100 or 11)
Teach-Repeat-Replan: A Complete and Robust System for Aggressive Flight in Complex Environments
C read INI file and write data to INI file
Houdini fluid > > particle fluid export to unity note
[极客大挑战 2019]Havefun1
数据库之MySQL——基础篇
DVWA靶场练习
《内网安全攻防:渗透测试实战指南》读书笔记(四):权限提升分析及防御
Essays (updated from time to time)
SAP self created table log function is enabled
RAID0和RAID5的创建和模拟RAID5工作原理
Expression related to month, year and day in SVG
聊聊接口幂等与消费幂等的本质
BUUCTF MISC刷題
Intranet penetration series: icmpsh of Intranet tunnel
KCD_EXCEL_OLE_TO_INT_CONVERT报错SY-subrc = 2
Intranet penetration series: icmptunnel of Intranet tunnel (Master James Barlow's)