当前位置:网站首页>Find out the maximum value of each column element of NxN matrix and store it in the one-dimensional array indicated by formal parameter B in order
Find out the maximum value of each column element of NxN matrix and store it in the one-dimensional array indicated by formal parameter B in order
2022-06-26 16:44:00 【Muzi..】
#include<stdio.h>
#define N 4
void fun(int (*a)[N],int *b);
int main()
{
int x[N][N]={
{
12,5,8,7},{
6,1,9,3},{
1,2,3,4},{
2,8,4,3}};
int y[N],i,j;
printf("the matrix:\n");
for(i=0;i<N;i++)
{
for(j=0;j<N;j++)
printf("%4d",x[i][j]);
printf("\n");
}
fun(x,y);
printf("\n the result is:");
for(i=0;i<N;i++)
printf("%3d",y[i]);
printf("\n");
}
void fun(int (*a)[N],int *b)
{
int i,j;
for(i=0;i<N;i++)
{
b[i]=a[0][i];
for(j=1;j<N;j++)
if(b[i]<a[j][i])
b[i]=a[j][i];
}
}
边栏推荐
- Science | giant bacteria found in mangroves challenge the traditional concept of nuclear free membrane
- Gui+sqlserver examination system
- 【从删库到跑路】MySQL基础 完结篇(入个门先跑路了。。)
- Science | 红树林中发现的巨型细菌挑战传统无核膜观念
- 用Attention和微调BERT进行自然语言推断-PyTorch
- How to separate jar packages and resource files according to packaging?
- Redis 概述整理
- Greenplum database fault analysis - semop (id=2000421076, num=11) failed: invalid argument
- 无需人工先验!港大&同济&LunarAI&旷视提出基于语义分组的自监督视觉表征学习,显著提升目标检测、实例分割和语义分割任务!...
- Cuckoo filter for Chang'an chain transaction
猜你喜欢
Scala 基础 (二):变量和数据类型

JUnit unit test

What does the inner structure of the neural network "alchemy furnace" look like? An interpretation of the thesis by the doctor of Oxford University

How to implement interface current limiting?

【毕业季】致毕业生的一句话:天高任鸟飞,海阔凭鱼跃
Scala Basics (II): variables and data types

Screenshot of the answers to C language exercises
![[Li Kou brush questions] 11 Container holding the most water //42 Rain water connection](/img/45/1e712300ea655856762394fba09066.png)
[Li Kou brush questions] 11 Container holding the most water //42 Rain water connection

Make up the weakness - Open Source im project openim about initialization / login / friend interface document introduction

架构实战营毕业设计
随机推荐
Science | 红树林中发现的巨型细菌挑战传统无核膜观念
Pybullet robot simulation environment construction 5 Robot pose visualization
In a bad mood, I just write code like this
MHA switching (recommended operation process)
[207] several possible causes of Apache crash
Niuke programming problem -- dynamic programming of must brush 101 (a thorough understanding of dynamic programming)
基于Kubebuilder开发Operator(入门使用)
proxy
R329 (maix-ii-a (M2A) data summary
C language --- basic function realization of push box 01
# 补齐短板-开源IM项目OpenIM关于初始化/登录/好友接口文档介绍
C语言所有知识点小结
Développer un opérateur basé sur kubebuilder (démarrer)
Kept to implement redis autofailover (redisha)
Dialogue with the senior management of Chang'an Mazda, new products will be released in Q4, and space and intelligence will lead the Japanese system
无需人工先验!港大&同济&LunarAI&旷视提出基于语义分组的自监督视觉表征学习,显著提升目标检测、实例分割和语义分割任务!...
y=1/100*100+1/200*200+1/300*300+.....+ 1/m*m
What is the preferential account opening policy of securities companies now? Is it safe to open an account online now?
IAR engineering adapts gd32 chip
Day10 daily 3 questions (3): String Matching in array