Signed-off-by: Idiot <2777566203@qq.com>
This commit is contained in:
2026-04-06 21:36:26 +08:00
commit 59113dd185
5 changed files with 448 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#include <stdio.h>
#include <stdlib.h>
#include "bank.h"
void ClearInput()
{
while(getchar() != '\n');
}
int GetInputInt(const char *prompt)
{
int value;
printf("%s", prompt);
while(scanf("%d", &value) != 1) {
ClearInput();
printf("输入错误,请重新输入: ");
}
return value;
}
double GetInputDouble(const char *prompt)
{
double value;
printf("%s", prompt);
while(scanf("%lf", &value) != 1) {
ClearInput();
printf("输入错误,请重新输入: ");
}
return value;
}