40 lines
674 B
C++
40 lines
674 B
C++
|
#include "ui_helper.h"
|
|||
|
#include <Windows.h>
|
|||
|
#include <cstdlib>
|
|||
|
#include <cstdio>
|
|||
|
|
|||
|
void ClearScreen()
|
|||
|
{
|
|||
|
system("cls");
|
|||
|
}
|
|||
|
|
|||
|
void ClearInput()
|
|||
|
{
|
|||
|
int c;
|
|||
|
while ((c = getchar()) != '\n' && c != EOF);
|
|||
|
}
|
|||
|
|
|||
|
void WaitPause()
|
|||
|
{
|
|||
|
system("pause");
|
|||
|
}
|
|||
|
|
|||
|
void title(const std::string& xtitle)
|
|||
|
{
|
|||
|
ClearScreen();
|
|||
|
printf("==============================\n");
|
|||
|
printf("%s\n", xtitle.c_str());
|
|||
|
printf("==============================\n");
|
|||
|
}
|
|||
|
|
|||
|
int GetChoice(int max_id)
|
|||
|
{
|
|||
|
int x;
|
|||
|
while (scanf("%d", &x) != 1 || x<1 || x>max_id)
|
|||
|
{
|
|||
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. ӦΪ<D3A6><CEAA>1~%d<><64>Χ<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n", max_id);
|
|||
|
ClearInput();
|
|||
|
}
|
|||
|
ClearInput();
|
|||
|
return x;
|
|||
|
}
|