0
Follow
0
View

C language two-dimensional array input error

lijian672 注册会员
2023-02-25 18:09

the reference answer GPT ᴼ ᴾ ᴱ ᴺ ᴬ ᴵ < br / > in the input 1 1 1 1 1 1 1 1 1, your input is correct, every input a digital press the space key segmentation, When a line is entered, press Enter to indicate that the line is finished. When printing the result, the newline "\n" is missing because you are using the printf function. So it's going to be on the same line. By modifying printf("%d", a[i][j]) to printf("%d", a[i][j]), you can output a space after the number, making the result more clear and easy to read. Also, at the end of each line, you need to add a newline character by placing printf("\n") outside the if statement.
-
When you input a two-dimensional array, press Enter after each line of digits to complete the input. If you do not press Enter, the program will treat all the numbers as the same line of input, resulting in incorrect results.

csfxxaq 注册会员
2023-02-25 18:09
< div class = " md_content_show“数据- v - 3967 e397 = " " >

< div class = " aw-list-img " > img

dlzthzzh 注册会员
2023-02-25 18:09
  • What you have here is a 4-by-4 two-dimensional array with 16 elements, You have to enter 16 of them.
  • The numbers can be separated by Spaces or newlines.

About the Author

Question Info

Publish Time
2023-02-25 18:09
Update Time
2023-02-25 18:09