重构输入处理:统一使用get_integer_input函数替换scanf

This commit is contained in:
2025-07-23 09:37:54 +08:00
parent 59c816767b
commit fbe4f5273c
5 changed files with 65 additions and 150 deletions
+1 -3
View File
@@ -289,10 +289,8 @@ void display_game_scores(int game_mode)
*/
void handle_save_record(int game_mode)
{
int save_choice = 0;
printf("===== 游戏结束 =====\n");
printf("是否保存游戏记录? (1-是, 0-否): ");
scanf("%d", &save_choice);
int save_choice = get_integer_input("是否保存游戏记录? (1-是, 0-否): ", 0, 1);
if (save_choice == 1)
{