Home > database >  Can teach me, just contact with C language, a dork for help, thank you!
Can teach me, just contact with C language, a dork for help, thank you!

Time:09-30

Title description
Write a function that given a 3 x3 two-dimensional integer array transposed, namely swaps, data input and output are completed in the main function,

The input description
Please input a 3 x3 each element of the array, separated with a space between

Output description
Output transposed respectively before and after the transpose array
The output format for % 5 d

The input sample
1 2 3 4 5 6 7 8 9

The output sample
The original array
1 2 3
4 5 6
7 8 9
Convert an array
1 4 7
2 5 8
3 6 9

CodePudding user response:

字输错了,

CodePudding user response:

Give you an idea, you see in front of the transposed array, as a two dimensional array [0] a [0] - a [2], [2], and then you can find the regularity of a [0] [1] is a [1] after the transpose [0], a [0] [2] is a [2] after the transpose [0], believe you see, even if the one-dimensional and two-dimensional subscript subscript swaps, of course 1, 5, 9 of these two interchangeable result is still the same,

CodePudding user response:

I wrong words above,,, even if=is that the two=the three

CodePudding user response:

But is the number of input that a few time, I how the output is three lines of three columns? I don't come, transpose I know!
  • Related