当前位置:网站首页>Maximum value and subscript of acquisition matrix of C language test question 168

Maximum value and subscript of acquisition matrix of C language test question 168

2022-06-09 22:18:00 Maserati

Personal home page : Personal home page
Series column :C Language test questions 200 example
Recommend a brush algorithm 、 written examination 、 Face the 、 Nada Corporation offer Artifact Click jump to enter the website
Author's brief introduction : Hello everyone , I'm Maserati ,CSDN Blogger ( Ranking of the whole station Top 50), Alibaba cloud blog expert 、51CTO Blogger 、 Huawei cloud sharing expert

1、 subject

subject : A two-dimensional array is required to convert a 3×4 The maximum value and its subscript of all elements in the matrix of

analysis :
For this example , There are two steps to write a program to complete : The first step is to find the maximum value of the matrix element , You can compare by the size of adjacent elements , Finally get the maximum value ; The second step is to get the maximum value of the element , Find the subscript of the element .

The general representation of two-dimensional array elements is :“ Array name [ Subscript ][ Subscript ]”. For two dimensional arrays , Subscript variables and array descriptions are the same in terms of representation , Like in this case , There are sentences :int a[3][4]; a[3][4]=2/3;

In the above sentence “a[3][4]” It's two completely different concepts , In the first statement “a[3][4]” Used to define an array , In the second statement “a[3][4]” Is a double subscript variable .






2 、 reminder

原网站

版权声明
本文为[Maserati]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206092135276078.html