我将如何将已计算的数字放入数组中?例如,如果我有以下功能:
int sum_even ( int p1, int p3, int p5, int p7, int p9, int p11){
even_total = array_1[1] + array_1[3] + array_1[5] + array_1[7] + array_1[9] + array_1[11];
printf("The sum of the even numbers: %d\n", even_total);
return;
}
int sum_odd (int p2, int p4, int p6, int p8, int p10, int p12){
odd_total = array_1[0] + array_1[2] + array_1[4] + array_1[6] + array_1[8] + array_1[10] + array_1[12];
printf( "The sum of the odd numbers: %d\n", odd_total);
return;
}
int total (int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8, int p9, int p10, p11, p12){
total_all = odd_total + even_total;
printf( "The total of the numbers is: %d\n", total_all);
return;
}
现在说偶数和奇数的总和 (total_all) 是 18。我将如何拆分它们以便 array_2[1] 为 1 而 array_2[2] 为 8?