三个炉子三个燃烧信号最多两个燃烧信号为1最少一个燃烧信号。两个燃烧信号为1两个炉子投自动时燃烧时间短的炉子默认分配煤气115000燃烧时间长的炉子默认分配煤气85000。两个燃烧信号为1一个炉子投自动时投自动的炉子煤气分配200000减去另一个炉子手动时的煤气量。一个燃烧信号为1当这个炉子投自动时默认分配1300000。// adjustgas.cpp : 定义控制台应用程序的入口点。//#includestdafx.h#includestdio.h#includemath.h// 使用多个数组表示炉子属性#defineMAX_FURNACES3// 全局常量定义#defineMIN_GAS_MANUAL20000.0// 煤气量最小值不低于20000#defineGAS_TWO_AUTO_SHORT115000.0#defineGAS_TWO_AUTO_LONG85000.0#defineGAS_TOTAL_TWO200000.0#defineGAS_ONE_AUTO1300000.0#defineSTEP_CHANGE1000.0// 阶梯变化步长#defineERROR_VALUE-1.0// 错误代码// 全局变量用于存储上一次的煤气设定值staticdoubleprevious_gas_values[MAX_FURNACES]{0.0,0.0,0.0};staticbool first_runtrue;// 标记是否为第一次运行/** * 计算阶梯变化后的煤气值 * param target_value 目标煤气值 * param current_value 当前煤气值 * return 经过阶梯变化后的煤气值 */doubleapply_step_change(doubletarget_value,doublecurrent_value){if(fabs(target_value-current_value)STEP_CHANGE){returntarget_value;// 差值小于步长直接设置为目标值}if(target_valuecurrent_value){// 阶梯增长returncurrent_valueSTEP_CHANGE;}else{// 阶梯下降doublenew_valuecurrent_value-STEP_CHANGE;return(new_valueMIN_GAS_MANUAL)?new_value:MIN_GAS_MANUAL;}}/** * 确保煤气值不低于最小值 * param gas_value 煤气值 * return 经过最小值限制的煤气值 */doubleensure_min_gas(doublegas_value){return(gas_valueMIN_GAS_MANUAL)?MIN_GAS_MANUAL:gas_value;}/** * 分配煤气量并返回结果数组 * param id 炉子编号数组 * param burn_signal 燃烧信号数组 * param auto_mode 自动模式数组 * param gas_amount 煤气量数组手动模式炉子的初始煤气量 * param burn_time 燃烧时间数组 * param size 炉子数量 * return 返回指向煤气流量设定值数组的指针如果出错则返回NULL */double*allocate_gas_return_array(intid[],bool burn_signal[],bool auto_mode[],doublegas_amount[],intburn_time[],intsize){// 静态数组用于返回结果staticdoubleresult_gas[MAX_FURNACES];// 输入验证if(size!MAX_FURNACES){printf(错误必须正好有3个炉子\n);returnNULL;}// 如果是第一次运行初始化previous_gas_valuesif(first_run){for(inti0;isize;i){previous_gas_values[i]ensure_min_gas(gas_amount[i]);}first_runfalse;}// 初始化结果数组先设置为当前值for(inti0;isize;i){result_gas[i]previous_gas_values[i];}// 统计燃烧信号为1的数量intburn_count0;intburning_indices[2];// 存储燃烧炉子的索引for(inti0;isize;i){if(burn_signal[i]){if(burn_count2){burning_indices[burn_count]i;}burn_count;}}// 检查燃烧信号数量if(burn_count1||burn_count2){printf(错误燃烧信号数量必须为1或2\n);returnNULL;}// 统计投自动的炉子数量intauto_count0;for(inti0;isize;i){if(auto_mode[i]){auto_count;}}// 检查手动模式炉子的煤气量是否已设置for(inti0;isize;i){if(burn_signal[i]!auto_mode[i]){if(gas_amount[i]MIN_GAS_MANUAL){printf(错误手动模式炉子%d的煤气量必须不小于%.0f\n,id[i],MIN_GAS_MANUAL);returnNULL;}}}// 情况1两个燃烧信号if(burn_count2){intidx1burning_indices[0];intidx2burning_indices[1];// 确定燃烧时间长短intshort_idxidx1;intlong_idxidx2;if(burn_time[idx1]burn_time[idx2]){short_idxidx2;long_idxidx1;}// 情况1.1两个炉子都投自动if(auto_count2){doubletarget_shortensure_min_gas(GAS_TWO_AUTO_SHORT);doubletarget_longensure_min_gas(GAS_TWO_AUTO_LONG);result_gas[short_idx]apply_step_change(target_short,result_gas[short_idx]);result_gas[long_idx]apply_step_change(target_long,result_gas[long_idx]);}// 情况1.2一个炉子投自动elseif(auto_count1){intmanual_idx-1;intauto_idx-1;// 找出手动和自动的炉子for(inti0;i2;i){intidxburning_indices[i];if(auto_mode[idx]){auto_idxidx;}else{manual_idxidx;}}if(manual_idx!-1auto_idx!-1){// 手动模式炉子保持其设定值doublemanual_gasensure_min_gas(gas_amount[manual_idx]);result_gas[manual_idx]apply_step_change(manual_gas,result_gas[manual_idx]);// 自动模式炉子计算目标值doubletarget_autoensure_min_gas(GAS_TOTAL_TWO-result_gas[manual_idx]);result_gas[auto_idx]apply_step_change(target_auto,result_gas[auto_idx]);}}}// 情况2一个燃烧信号elseif(burn_count1){for(inti0;isize;i){if(burn_signal[i]){if(auto_mode[i]){doubletarget_gasensure_min_gas(GAS_ONE_AUTO);result_gas[i]apply_step_change(target_gas,result_gas[i]);}else{// 手动模式doublemanual_gasensure_min_gas(gas_amount[i]);result_gas[i]apply_step_change(manual_gas,result_gas[i]);}break;}}}// 更新previous_gas_valuesfor(inti0;isize;i){previous_gas_values[i]result_gas[i];}returnresult_gas;}/** * 打印炉子状态 */voidprint_furnace_status_return(intid[],bool burn_signal[],bool auto_mode[],doublegas_amount[],intburn_time[],doubleresult_gas[],intsize){printf(炉子状态\n);printf(ID\t燃烧信号\t自动模式\t燃烧时间\t初始煤气量\t设定煤气量\n);printf(-------------------------------------------------------------------------\n);for(inti0;isize;i){printf(%d\t%s\t\t%s\t\t%d\t\t%.0f\t\t%.0f\n,id[i],burn_signal[i]?1:0,auto_mode[i]?是:否,burn_time[i],gas_amount[i],result_gas[i]);}printf(\n);}/** * 打印煤气流量结果 */voidprint_gas_results(intid[],doublegas_values[],intsize){printf(煤气流量设定值\n);for(inti0;isize;i){printf(炉子%d: %.0f 立方米/小时\n,id[i],gas_values[i]);}printf(\n);}/** * 模拟多次运行演示阶梯变化效果 */voidsimulate_multiple_runs(){printf( 模拟阶梯变化效果 \n);inttest_ids[MAX_FURNACES]{1,2,3};bool test_burn_signals[MAX_FURNACES]{true,false,true};bool test_auto_modes[MAX_FURNACES]{true,false,true};doubletest_gas_amounts[MAX_FURNACES]{20000.0,0.0,20000.0};inttest_burn_times[MAX_FURNACES]{5,0,10};double*result_gas_ptrNULL;// 模拟运行5次展示阶梯变化for(intrun1;run5;run){printf(--- 运行次数: %d ---\n,run);result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptr!NULL){print_gas_results(test_ids,result_gas_ptr,MAX_FURNACES);}}}/** * 测试函数 */intmain(){// 定义测试数组inttest_ids[MAX_FURNACES];bool test_burn_signals[MAX_FURNACES];bool test_auto_modes[MAX_FURNACES];doubletest_gas_amounts[MAX_FURNACES];inttest_burn_times[MAX_FURNACES];double*result_gas_ptr;// 存储返回的数组指针// 重置first_run标志first_runtrue;// 测试用例1两个燃烧信号两个自动模式printf( 测试用例1两个燃烧信号两个自动模式 \n);inttest1_ids[]{1,2,3};bool test1_burn_signals[]{true,false,true};bool test1_auto_modes[]{true,false,true};doubletest1_gas_amounts[]{20000.0,0.0,20000.0};// 初始最小值inttest1_burn_times[]{5,0,10};// 燃烧时间炉子1短炉子3长for(inti0;iMAX_FURNACES;i){test_ids[i]test1_ids[i];test_burn_signals[i]test1_burn_signals[i];test_auto_modes[i]test1_auto_modes[i];test_gas_amounts[i]test1_gas_amounts[i];test_burn_times[i]test1_burn_times[i];}result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptr!NULL){print_furnace_status_return(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,result_gas_ptr,MAX_FURNACES);print_gas_results(test_ids,result_gas_ptr,MAX_FURNACES);}// 测试用例2两个燃烧信号一个自动模式printf( 测试用例2两个燃烧信号一个自动模式 \n);bool test2_burn_signals[]{true,false,true};bool test2_auto_modes[]{true,false,false};doubletest2_gas_amounts[]{20000.0,0.0,120000.0};// 炉子3手动已有煤气量for(inti0;iMAX_FURNACES;i){test_burn_signals[i]test2_burn_signals[i];test_auto_modes[i]test2_auto_modes[i];test_gas_amounts[i]test2_gas_amounts[i];}result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptr!NULL){print_furnace_status_return(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,result_gas_ptr,MAX_FURNACES);print_gas_results(test_ids,result_gas_ptr,MAX_FURNACES);}// 测试用例3一个燃烧信号一个自动模式printf( 测试用例3一个燃烧信号一个自动模式 \n);bool test3_burn_signals[]{true,false,false};bool test3_auto_modes[]{true,false,false};doubletest3_gas_amounts[]{20000.0,0.0,0.0};for(inti0;iMAX_FURNACES;i){test_burn_signals[i]test3_burn_signals[i];test_auto_modes[i]test3_auto_modes[i];test_gas_amounts[i]test3_gas_amounts[i];}result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptr!NULL){print_furnace_status_return(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,result_gas_ptr,MAX_FURNACES);print_gas_results(test_ids,result_gas_ptr,MAX_FURNACES);}// 测试用例4输入验证测试 - 错误的燃烧信号数量printf( 测试用例4输入验证测试 - 燃烧信号数量错误 \n);bool test4_burn_signals[]{false,false,false};for(inti0;iMAX_FURNACES;i){test_burn_signals[i]test4_burn_signals[i];}result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptrNULL){printf(输入验证成功燃烧信号数量为0分配失败\n);}// 测试用例5输入验证测试 - 手动模式未设置煤气量printf( 测试用例5输入验证测试 - 手动模式未设置煤气量 \n);bool test5_burn_signals[]{true,false,true};bool test5_auto_modes[]{true,false,false};doubletest5_gas_amounts[]{20000.0,0.0,15000.0};// 炉子3手动煤气量小于最小值for(inti0;iMAX_FURNACES;i){test_burn_signals[i]test5_burn_signals[i];test_auto_modes[i]test5_auto_modes[i];test_gas_amounts[i]test5_gas_amounts[i];}result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptrNULL){printf(输入验证成功手动模式炉子未设置煤气量分配失败\n);}// 模拟阶梯变化效果printf(\n);simulate_multiple_runs();return0;}
负荷自适应分配阶梯变化
三个炉子三个燃烧信号最多两个燃烧信号为1最少一个燃烧信号。两个燃烧信号为1两个炉子投自动时燃烧时间短的炉子默认分配煤气115000燃烧时间长的炉子默认分配煤气85000。两个燃烧信号为1一个炉子投自动时投自动的炉子煤气分配200000减去另一个炉子手动时的煤气量。一个燃烧信号为1当这个炉子投自动时默认分配1300000。// adjustgas.cpp : 定义控制台应用程序的入口点。//#includestdafx.h#includestdio.h#includemath.h// 使用多个数组表示炉子属性#defineMAX_FURNACES3// 全局常量定义#defineMIN_GAS_MANUAL20000.0// 煤气量最小值不低于20000#defineGAS_TWO_AUTO_SHORT115000.0#defineGAS_TWO_AUTO_LONG85000.0#defineGAS_TOTAL_TWO200000.0#defineGAS_ONE_AUTO1300000.0#defineSTEP_CHANGE1000.0// 阶梯变化步长#defineERROR_VALUE-1.0// 错误代码// 全局变量用于存储上一次的煤气设定值staticdoubleprevious_gas_values[MAX_FURNACES]{0.0,0.0,0.0};staticbool first_runtrue;// 标记是否为第一次运行/** * 计算阶梯变化后的煤气值 * param target_value 目标煤气值 * param current_value 当前煤气值 * return 经过阶梯变化后的煤气值 */doubleapply_step_change(doubletarget_value,doublecurrent_value){if(fabs(target_value-current_value)STEP_CHANGE){returntarget_value;// 差值小于步长直接设置为目标值}if(target_valuecurrent_value){// 阶梯增长returncurrent_valueSTEP_CHANGE;}else{// 阶梯下降doublenew_valuecurrent_value-STEP_CHANGE;return(new_valueMIN_GAS_MANUAL)?new_value:MIN_GAS_MANUAL;}}/** * 确保煤气值不低于最小值 * param gas_value 煤气值 * return 经过最小值限制的煤气值 */doubleensure_min_gas(doublegas_value){return(gas_valueMIN_GAS_MANUAL)?MIN_GAS_MANUAL:gas_value;}/** * 分配煤气量并返回结果数组 * param id 炉子编号数组 * param burn_signal 燃烧信号数组 * param auto_mode 自动模式数组 * param gas_amount 煤气量数组手动模式炉子的初始煤气量 * param burn_time 燃烧时间数组 * param size 炉子数量 * return 返回指向煤气流量设定值数组的指针如果出错则返回NULL */double*allocate_gas_return_array(intid[],bool burn_signal[],bool auto_mode[],doublegas_amount[],intburn_time[],intsize){// 静态数组用于返回结果staticdoubleresult_gas[MAX_FURNACES];// 输入验证if(size!MAX_FURNACES){printf(错误必须正好有3个炉子\n);returnNULL;}// 如果是第一次运行初始化previous_gas_valuesif(first_run){for(inti0;isize;i){previous_gas_values[i]ensure_min_gas(gas_amount[i]);}first_runfalse;}// 初始化结果数组先设置为当前值for(inti0;isize;i){result_gas[i]previous_gas_values[i];}// 统计燃烧信号为1的数量intburn_count0;intburning_indices[2];// 存储燃烧炉子的索引for(inti0;isize;i){if(burn_signal[i]){if(burn_count2){burning_indices[burn_count]i;}burn_count;}}// 检查燃烧信号数量if(burn_count1||burn_count2){printf(错误燃烧信号数量必须为1或2\n);returnNULL;}// 统计投自动的炉子数量intauto_count0;for(inti0;isize;i){if(auto_mode[i]){auto_count;}}// 检查手动模式炉子的煤气量是否已设置for(inti0;isize;i){if(burn_signal[i]!auto_mode[i]){if(gas_amount[i]MIN_GAS_MANUAL){printf(错误手动模式炉子%d的煤气量必须不小于%.0f\n,id[i],MIN_GAS_MANUAL);returnNULL;}}}// 情况1两个燃烧信号if(burn_count2){intidx1burning_indices[0];intidx2burning_indices[1];// 确定燃烧时间长短intshort_idxidx1;intlong_idxidx2;if(burn_time[idx1]burn_time[idx2]){short_idxidx2;long_idxidx1;}// 情况1.1两个炉子都投自动if(auto_count2){doubletarget_shortensure_min_gas(GAS_TWO_AUTO_SHORT);doubletarget_longensure_min_gas(GAS_TWO_AUTO_LONG);result_gas[short_idx]apply_step_change(target_short,result_gas[short_idx]);result_gas[long_idx]apply_step_change(target_long,result_gas[long_idx]);}// 情况1.2一个炉子投自动elseif(auto_count1){intmanual_idx-1;intauto_idx-1;// 找出手动和自动的炉子for(inti0;i2;i){intidxburning_indices[i];if(auto_mode[idx]){auto_idxidx;}else{manual_idxidx;}}if(manual_idx!-1auto_idx!-1){// 手动模式炉子保持其设定值doublemanual_gasensure_min_gas(gas_amount[manual_idx]);result_gas[manual_idx]apply_step_change(manual_gas,result_gas[manual_idx]);// 自动模式炉子计算目标值doubletarget_autoensure_min_gas(GAS_TOTAL_TWO-result_gas[manual_idx]);result_gas[auto_idx]apply_step_change(target_auto,result_gas[auto_idx]);}}}// 情况2一个燃烧信号elseif(burn_count1){for(inti0;isize;i){if(burn_signal[i]){if(auto_mode[i]){doubletarget_gasensure_min_gas(GAS_ONE_AUTO);result_gas[i]apply_step_change(target_gas,result_gas[i]);}else{// 手动模式doublemanual_gasensure_min_gas(gas_amount[i]);result_gas[i]apply_step_change(manual_gas,result_gas[i]);}break;}}}// 更新previous_gas_valuesfor(inti0;isize;i){previous_gas_values[i]result_gas[i];}returnresult_gas;}/** * 打印炉子状态 */voidprint_furnace_status_return(intid[],bool burn_signal[],bool auto_mode[],doublegas_amount[],intburn_time[],doubleresult_gas[],intsize){printf(炉子状态\n);printf(ID\t燃烧信号\t自动模式\t燃烧时间\t初始煤气量\t设定煤气量\n);printf(-------------------------------------------------------------------------\n);for(inti0;isize;i){printf(%d\t%s\t\t%s\t\t%d\t\t%.0f\t\t%.0f\n,id[i],burn_signal[i]?1:0,auto_mode[i]?是:否,burn_time[i],gas_amount[i],result_gas[i]);}printf(\n);}/** * 打印煤气流量结果 */voidprint_gas_results(intid[],doublegas_values[],intsize){printf(煤气流量设定值\n);for(inti0;isize;i){printf(炉子%d: %.0f 立方米/小时\n,id[i],gas_values[i]);}printf(\n);}/** * 模拟多次运行演示阶梯变化效果 */voidsimulate_multiple_runs(){printf( 模拟阶梯变化效果 \n);inttest_ids[MAX_FURNACES]{1,2,3};bool test_burn_signals[MAX_FURNACES]{true,false,true};bool test_auto_modes[MAX_FURNACES]{true,false,true};doubletest_gas_amounts[MAX_FURNACES]{20000.0,0.0,20000.0};inttest_burn_times[MAX_FURNACES]{5,0,10};double*result_gas_ptrNULL;// 模拟运行5次展示阶梯变化for(intrun1;run5;run){printf(--- 运行次数: %d ---\n,run);result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptr!NULL){print_gas_results(test_ids,result_gas_ptr,MAX_FURNACES);}}}/** * 测试函数 */intmain(){// 定义测试数组inttest_ids[MAX_FURNACES];bool test_burn_signals[MAX_FURNACES];bool test_auto_modes[MAX_FURNACES];doubletest_gas_amounts[MAX_FURNACES];inttest_burn_times[MAX_FURNACES];double*result_gas_ptr;// 存储返回的数组指针// 重置first_run标志first_runtrue;// 测试用例1两个燃烧信号两个自动模式printf( 测试用例1两个燃烧信号两个自动模式 \n);inttest1_ids[]{1,2,3};bool test1_burn_signals[]{true,false,true};bool test1_auto_modes[]{true,false,true};doubletest1_gas_amounts[]{20000.0,0.0,20000.0};// 初始最小值inttest1_burn_times[]{5,0,10};// 燃烧时间炉子1短炉子3长for(inti0;iMAX_FURNACES;i){test_ids[i]test1_ids[i];test_burn_signals[i]test1_burn_signals[i];test_auto_modes[i]test1_auto_modes[i];test_gas_amounts[i]test1_gas_amounts[i];test_burn_times[i]test1_burn_times[i];}result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptr!NULL){print_furnace_status_return(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,result_gas_ptr,MAX_FURNACES);print_gas_results(test_ids,result_gas_ptr,MAX_FURNACES);}// 测试用例2两个燃烧信号一个自动模式printf( 测试用例2两个燃烧信号一个自动模式 \n);bool test2_burn_signals[]{true,false,true};bool test2_auto_modes[]{true,false,false};doubletest2_gas_amounts[]{20000.0,0.0,120000.0};// 炉子3手动已有煤气量for(inti0;iMAX_FURNACES;i){test_burn_signals[i]test2_burn_signals[i];test_auto_modes[i]test2_auto_modes[i];test_gas_amounts[i]test2_gas_amounts[i];}result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptr!NULL){print_furnace_status_return(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,result_gas_ptr,MAX_FURNACES);print_gas_results(test_ids,result_gas_ptr,MAX_FURNACES);}// 测试用例3一个燃烧信号一个自动模式printf( 测试用例3一个燃烧信号一个自动模式 \n);bool test3_burn_signals[]{true,false,false};bool test3_auto_modes[]{true,false,false};doubletest3_gas_amounts[]{20000.0,0.0,0.0};for(inti0;iMAX_FURNACES;i){test_burn_signals[i]test3_burn_signals[i];test_auto_modes[i]test3_auto_modes[i];test_gas_amounts[i]test3_gas_amounts[i];}result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptr!NULL){print_furnace_status_return(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,result_gas_ptr,MAX_FURNACES);print_gas_results(test_ids,result_gas_ptr,MAX_FURNACES);}// 测试用例4输入验证测试 - 错误的燃烧信号数量printf( 测试用例4输入验证测试 - 燃烧信号数量错误 \n);bool test4_burn_signals[]{false,false,false};for(inti0;iMAX_FURNACES;i){test_burn_signals[i]test4_burn_signals[i];}result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptrNULL){printf(输入验证成功燃烧信号数量为0分配失败\n);}// 测试用例5输入验证测试 - 手动模式未设置煤气量printf( 测试用例5输入验证测试 - 手动模式未设置煤气量 \n);bool test5_burn_signals[]{true,false,true};bool test5_auto_modes[]{true,false,false};doubletest5_gas_amounts[]{20000.0,0.0,15000.0};// 炉子3手动煤气量小于最小值for(inti0;iMAX_FURNACES;i){test_burn_signals[i]test5_burn_signals[i];test_auto_modes[i]test5_auto_modes[i];test_gas_amounts[i]test5_gas_amounts[i];}result_gas_ptrallocate_gas_return_array(test_ids,test_burn_signals,test_auto_modes,test_gas_amounts,test_burn_times,MAX_FURNACES);if(result_gas_ptrNULL){printf(输入验证成功手动模式炉子未设置煤气量分配失败\n);}// 模拟阶梯变化效果printf(\n);simulate_multiple_runs();return0;}