二年級數學下冊期末考試試卷及答案(精選3套)
程序題,沒有規定用什么語言:

n個選項,每個選項里面又有若干個子選項,從每個選項中選一個子選項,一共有多少個組合。
#include
#define N 3 /pic/p>
#define Alen 3 /pic/p>
#define Blen 3 /pic/p>
#define Clen 3 /pic/p>
int num = 0; /pic/p>
char A[N][Alen] = {{’A', ‘B’, ‘C’}, {’D', ‘E’, ‘F’}, {’H', ‘I’, ‘J’}};/pic/p>
int Len[N] = {Alen, Blen, Clen};/pic/p>
int Path[N];/pic/p>
void Recrusive(int i)
{
/pic/p>
if (i >= N)
{
int k;
num++;
printf(”%d: “,num);
for (k = 0; k < N; k++)
{
printf(”%c “, Path[k]);
}
printf(”\n”);
return;
}
int j ;
for (j = 0; j < Len[i]; j++)
{
/pic/p>
Path[i] = A[i][j];
/pic/p>
Recrusive(i + 1);
}
}
void main()
{ Recrusive(0);
}
【二年級數學下冊期末考試試卷及答案】相關文章:
二年級數學下冊期末考試卷答案05-24
二年級數學下冊期末考試試卷答案12-24
二年級下冊數學期末考試卷及答案06-16
二年級語文下冊期末考試試卷及答案03-15
二年級下冊語文期末考試卷及答案02-28
二年級下冊語文期末考試卷答案04-11
二年級英語下冊期末考試卷答案及解析03-05
二年級下冊語文期末考試試卷答案分析05-20
初一數學下冊期末考試試卷04-23