当前位置:网站首页>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;
}
}
边栏推荐
- 电路中缓存的几种形式
- Redis Guide (8): principle and implementation of Qianfan Jingfa distributed lock
- JUnit unit test
- Overall context of concurrent programming
- Data analysis - numpy quick start
- Kept to implement redis autofailover (redisha) 1
- Science | giant bacteria found in mangroves challenge the traditional concept of nuclear free membrane
- JS tutorial - printing stickers / labels using the electronjs desktop application
- Calculate a=1, a2=1/1=a1
- Learn about common functional interfaces
猜你喜欢
C language --- basic function realization of push box 01
基于Kubebuilder开发Operator(入门使用)
5g is not flat and 6G is restarted. China leads wireless communication. What is the biggest advantage of 6G?
Niuke programming problem -- dynamic programming of must brush 101 (a thorough understanding of dynamic programming)
Research on natural transition dubbing processing scheme based on MATLAB
Cuckoo filter for Chang'an chain transaction
内存分区模型
Summary of all knowledge points of C language
Knowing these commands allows you to master shell's own tools
R329 (maix-ii-a (M2A) data summary
随机推荐
【力扣刷题】11.盛最多水的容器//42.接雨水
JS tutorial using electron JS build native desktop application ping pong game
C language --- basic function realization of push box 01
R language plot visualization: plot visualizes the normalized histogram, adds the density curve KDE to the histogram, and uses geom at the bottom edge of the histogram_ Adding edge whisker graph with
Gui+sqlserver examination system
Redis migration (recommended operation process) 1
Scala Foundation (2): variables et types de données
【毕业季】致毕业生的一句话:天高任鸟飞,海阔凭鱼跃
JS教程之使用 ElectronJS、VueJS、SQLite 和 Sequelize ORM 从 A 到 Z 创建多对多 CRUD 应用程序
JS教程之使用 ElectronJS 桌面应用程序打印贴纸/标签
Codeforces Round #802 (Div. 2)
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
精致妆容成露营“软实力”,唯品会户外美妆护肤产品销量激增
Redis顺序排序命令
Cloud platform monitoring system based on stm32+ Huawei cloud IOT design
建立自己的网站(16)
Several forms of buffer in circuit
108. 简易聊天室11:实现客户端群聊
Interpretation of cloud native microservice technology trend