|
@ -27,6 +27,24 @@ int* randomNumber() { |
|
|
return arr; |
|
|
return arr; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int* randomNumber1() { |
|
|
|
|
|
srand(time(NULL)); |
|
|
|
|
|
int k = 0, p; |
|
|
|
|
|
static int arr[32]; |
|
|
|
|
|
while(k<32){ |
|
|
|
|
|
int num =rand()%32; |
|
|
|
|
|
for (p = 0; p < k; p++){ |
|
|
|
|
|
if(arr[p]==num){ |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(p==k){ |
|
|
|
|
|
arr[k++]=num; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return arr; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//------------Math_quiz_begin------------ |
|
|
//------------Math_quiz_begin------------ |
|
|
|
|
|
|
|
@ -115,20 +133,7 @@ void math_choose_question(int num1) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
srand(time(NULL)); |
|
|
|
|
|
int k = 0, p; |
|
|
|
|
|
static int arr[32]; |
|
|
|
|
|
while(k<32) { |
|
|
|
|
|
int num = rand() % 32; |
|
|
|
|
|
for (p = 0; p < k; p++) { |
|
|
|
|
|
if (arr[p] == num) { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (p == k) { |
|
|
|
|
|
arr[k++] = num; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int* arr = randomNumber1(); |
|
|
|
|
|
|
|
|
int num2 = arr[num1]; |
|
|
int num2 = arr[num1]; |
|
|
printf("%s", choose[num2]); |
|
|
printf("%s", choose[num2]); |
|
@ -170,20 +175,7 @@ int math_answer(int num1) { |
|
|
80, |
|
|
80, |
|
|
10 |
|
|
10 |
|
|
}; |
|
|
}; |
|
|
srand(time(NULL)); |
|
|
|
|
|
int k = 0, p; |
|
|
|
|
|
static int arr[32]; |
|
|
|
|
|
while(k<32) { |
|
|
|
|
|
int num = rand() % 32; |
|
|
|
|
|
for (p = 0; p < k; p++) { |
|
|
|
|
|
if (arr[p] == num) { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (p == k) { |
|
|
|
|
|
arr[k++] = num; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int* arr = randomNumber1(); |
|
|
|
|
|
|
|
|
int num2 = arr[num1]; |
|
|
int num2 = arr[num1]; |
|
|
return ans[num2]; |
|
|
return ans[num2]; |
|
|