Home > Back-end >  5 C problem of the array class
5 C problem of the array class

Time:09-28

1. Programming to realize from the keyboard input any value to 3 Χ 4 two-dimensional array, and the lowest value of two dimensional array and the minimum in rows and columns,
2. For a 4 Χ 4 matrix 1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
The sum of the main diagonal elements (such as 1 + 6 + 11 + 16),

3. A matrix a=1 2 3 b=1 4
4 5 6 2
3 6
Asked to output the matrix a, and then a transposed into b and output,
4. Young singer song competition, there are 10 judges to score of singing, try programming, for each contestant's average score, if required to remove a and a minimum points, and how to implement,
5. Enter the three strings, find and output with minimum
 

CodePudding user response:

How do you a day for six code problem?
A little too much,
And only a 10 points, we are not so much time to write to you,
Look at your knot posted, a don't knot...
How is it possible to give you the code?
Hint:
 
1///////////////////////
Double p [3] [4].
for(int i=0; I<=2; + + I)
For (int a=0; a<=3; + + p)
Cin> P [I] [a];
/* * * * * * the rest of the do * * * * * */
//2//////////////////
Int num [4] [4].
Cout/* * * * * * the rest of the do * * * * * */
//3///////////////////
Int a [2] [3].
for(int i=0; I<=1; + + I)
{
If (I==1)
CoutFor (int p=0; p<=2; + + p)
Cout<[I] a [p] <& lt;" ";
}
/* * * * * * the rest of the do * * * * * */
/* * * * * * the rest of the do * * * * * */

CodePudding user response:

Write their own best, give you some hints,
1.
 
Int min=arr1 [0] [0].
for (i=0; I<3; I++)
{
For (j=0; J<4. J++)
{
If (min & gt; Arr1 [I] [j])
{
Min=arr1 [I] [j];
H=I;
L=j;
}

}
}
Cout & lt; <"The minimum value is" & lt;

2. The diagonal judgment
 
Int I, j, sum=0;
for (i=0; I<4. I++)
{
For (j=0; J<4. J++)
{
If (I==j)
The sum +=a, [I] [j].
}
}

3.
 
for (i=0; I<2; I++)
{
For (j=0; J<3; J++)
{
B [j] [I]=[I] [j];
}
}

4.
 
Int I, Max, min, sum=0, a1 [10]={0};
Float avge=0;
Min=a1 [0];
Max=0;
for (i=0; I<10; I++)
{
The sum +=a1 [I];
If (min & gt; A1 [I])
Min=a1 [I];
If (Max & lt; A1 [I])
Max=a1 [I];
}
Avge=(sum - min - Max)/8.0;

5. Use STRCMP function comparison, specific usage baidu

  • Related