麻烦高手指点一下!想利用一个数组创建另外一个数组,不知哪里出了错误。。
#include <stdio.h>void fun(int m, int n)
{
int b[][],f,h;
if (m % 2 == 0 && n % 3 == 0) {
for (f = 0; f<m; f++)
for (h = 0; h<n; h++)
{
if (0 == (h + 1) % 1)
b[f][h] = 1;
else if (0 == (h + 1) % 2)
b[f][h] = 2;
else if (0 == (h + 1) % 3)
b[f][h] = 3;
}
for (f = 0; f<m; f++)
for (h = 0; h<n; h++)
printf("d%", b[m][n]);
}
}
int main()
{
int a, b,m=6,n=9, c[2][3]={1,2,3,1,2,3};
fun(m, n);
}
[此贴子已经被作者于2016-4-12 19:47编辑过]