zoukankan
html css js c++ java
输出矩阵右上角元素
如果右上角元素大于左下角元素,然后交换。
输出经过处理后的右上角元素(含对角线)
#include
<
stdio.h
>
#include
<
conio.h
>
#define
M 4
#define
N 4
void
main()
{
clrscr();
int
i,j;
int
a[M][N]
=
{
{
13
,
22
,
33
,
44
}
,
{
5
,
63
,
7
,
8
}
,
{
91
,
10
,
11
,
12
}
,
{
13
,
14
,
15
,
16
}
}
;
for
(i
=
0
;i
<
M;i
++
)
{
for
(j
=
0
;j
<
N;j
++
)
printf(
"
%6d
"
,a[i][j]);
printf(
"
\n
"
);
}
for
(i
=
0
;i
<
M;i
++
)
for
(j
=
0
;j
<
N;j
++
)
if
(a[i][j]
>
a[j][i]) a[i][j]
=
a[j][i];
for
(i
=
0
;i
<
M;i
++
)
{ printf(
"
\n
"
);
for
(j
=
0
;j
<
N;j
++
)
if
(j
>=
i) printf(
"
%6d
"
,a[i][j]);
else
printf(
"
%6c
"
,
'
'
);
}
}
查看全文
相关阅读:
ASP.NET MVC 学习笔记 1
安装xp遇到的问题与如何连接共享的打印机
win8.1 安装
AspxGridView控件的使用
JS获取fileupload文件全路径
正则表达式的学习
回归起点
Vmware ESX 5.0 安装与部署
UITextField检测输入内容不能有空格的处理
关于cell自动布局约束实现高度自适应问题
原文地址:https://www.cnblogs.com/qixin622/p/621340.html
最新文章
inputstream获取网页信息
Android layout属性大全
HttpClient和HttpURLConnection的区别
Android中使用HttpGet和HttpPost访问HTTP资源
安卓解析 json 4种格式 全解析
getCount()和getChlidCount() 区别
使用Volley加载网络图片
spring mvc(注解)上传文件的简单例子
[转载] 【Shiro】Apache Shiro架构之实际运用(整合到Spring中)
Centos6.4 用rpm方式安装MySql5.6
热门文章
找出linux服务器IO占用高的程序
SSH登陆 Write failed: Broken pipe解决办法
脚本定时备份数据库
Celery 和 Redis 入门
linux后台进程管理工具supervisor
python分布式任务调度Celery
mysql查看bin日志命令
selenium +java + webdirver
分布式性能测试
selenium---定位
Copyright © 2011-2022 走看看