题解 | #序列重组矩阵#
序列重组矩阵
http://www.nowcoder.com/practice/7548f8f5e44c42fa84fb2323d899a966
#include<stdio.h>
int main()
{
int n, m;
int arr[10][10] = { 0 };//有没有更好的初始化方法
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++)
{
for (int x = 0; x < m; x++)
{
scanf("%d", &arr[i][x]);
}
}
for (int i = 0; i < n; i++)
{
for (int x = 0; x < m; x++)
{
printf("%d ", arr[i][x]);
}
printf("\n");
}
return 0;
}
int main()
{
int n, m;
int arr[10][10] = { 0 };//有没有更好的初始化方法
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++)
{
for (int x = 0; x < m; x++)
{
scanf("%d", &arr[i][x]);
}
}
for (int i = 0; i < n; i++)
{
for (int x = 0; x < m; x++)
{
printf("%d ", arr[i][x]);
}
printf("\n");
}
return 0;
}