当前位置:网站首页>Multiply the values of the upper triangular elements of the array by M
Multiply the values of the upper triangular elements of the array by M
2022-06-26 16:44:00 【Muzi..】
#include<stdio.h>
#include<stdlib.h>
#define N 5
void fun(int a[][N],int m);
int main()
{
int a[N][N],m,j,i;
printf("****the array***\n");
for(i=0;i<N;i++)
{
for(j=0;j<N;j++)
{
a[i][j]=rand()%20;
printf("%4d",a[i][j]);
}
printf("\n");
}
m=rand()%4;
printf("m=%d\n",m);
fun(a,m);
printf("the result\n");
for(i=0;i<N;i++)
{
for(j=0;j<N;j++)
printf("%4d",a[i][j]);
printf("\n");
}
}
void fun(int a[][N],int m)
{
int i,j;
for(j=0;j<N;j++)
for(i=0;i<N;i++)
{
if(i<=j)
a[i][j]*=m;
}
}
边栏推荐
- Greenplum数据库故障分析——semop(id=2000421076,num=11) failed: invalid argument
- Kubecon China 2021 Alibaba cloud special session is coming! These first day highlights should not be missed
- MS|谢黎炜组发现混合益生菌制剂及其代谢产物可缓解结肠炎
- Research on natural transition dubbing processing scheme based on MATLAB
- Binary array command of redis
- 数据分析----numpy快速入门
- Which position does Anxin securities rank? Is it safe to open an account?
- Overall context of concurrent programming
- Scala Foundation (2): variables et types de données
- 100+ data science interview questions and answers Summary - basic knowledge and data analysis
猜你喜欢

【从删库到跑路】JDBC 完结篇(一天学完系列!!学完赶紧跑!)

Learn about common functional interfaces

Constructors and Destructors

Supplement the short board - Open Source im project openim about initialization / login / friend interface document introduction

How to implement interface current limiting?

对话长安马自达高层,全新产品将在Q4发布,空间与智能领跑日系

Structure the graduation project of actual combat camp

C语言所有知识点小结

The details of the first pig heart transplantation were fully disclosed: human herpes virus was found in the patient, the weight of the heart doubled after death, and myocardial cell fibrosis

Screenshot of the answers to C language exercises
随机推荐
无需人工先验!港大&同济&LunarAI&旷视提出基于语义分组的自监督视觉表征学习,显著提升目标检测、实例分割和语义分割任务!...
C语言所有知识点小结
请指教同花顺软件究竟是什么?网上开户是否安全么?
构造函数和析构函数
C language --- basic function realization of push box 01
Stm32h7b0 replaces the h750 program, causing the MCU to hang up and unable to burn the program
[chat in 5] eight years after graduation, I have been pursuing my dream
proxy
Use the array to calculate the average of N numbers, and output the numbers greater than the average
Leetcode 1169. 查询无效交易(如果数据量不大,这种题还是得暴力枚举解决)
Gui+sqlserver examination system
了解下常见的函数式接口
What is the preferential account opening policy of securities companies now? Is it safe to open an account online now?
"C language" question set of ⑩
牛客编程题--必刷101之动态规划(一文彻底了解动态规划)
【从删库到跑路】JDBC 完结篇(一天学完系列!!学完赶紧跑!)
How to implement interface current limiting?
Calculate the average of N numbers in the index group of X, and return the number that is less than the average and closest to the average through formal parameters
Detailed explanation of cookies and sessions
Knowing these commands allows you to master shell's own tools