首页 > 解决方案 > 如何在二维数组中声明和存储值?

问题描述

我试图打印每对元素,而它是阶乘语言:language-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

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

标签: c#c

解决方案


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


推荐阅读