如何在二维数组中声明和存储值?

时间:2021-07-16 11:03:29

标签: c# c

我尝试在阶乘时打印每对元素 语言:语言-c

#include<studio library>//

in main function I try to store 2D array which size is
a[1][3];

And, I write these code

integer a[1][3] = {1,2,3,4,5};
and I find factorial of 5 = 120
I have to print three element together
it is possible 120 times;

so ,I can try 120 different value using print function function
in a[1][3];



like this output
1,2,3     is 1.
1,2,4     is 2.
1,2,5     is 3.
1,3,4     is 4.
1,3,5 up to 120

我想知道如何在二维数组中存储值 但数组是一个[1][3]

1 个答案:

答案 0 :(得分:1)

您可以将 j 和 k 的值设置为“i-dependent”,但它们不会更新它们的值,您应该在 i++ 旁边添加一个 j++,k++

相关问题