📄 utility.h
字号:
//utility.h程序开始
//作者Isaac Shaffer
//Utility Libray
// void Pause(),int GetInt(int L,int H),void signature(), int random(long hi, long lo)
#include<iostream.h>
#include<stdlib.h>
#include<conio.h>
#include<time.h>
//=========================================================
void pause()
//等待玩家任意输入一个键
{
cout<<"Press Any Key To Continue"<<endl;
getch();
}
//=========================================================
int GetInt(int L=0,int H=100)
{
int ent;
cout<<"Please Enter A Number Between "<<L<<" and "<<H<<endl;
cin>>ent;
while((ent<L)||(ent>H))
{
cout<<"Error"<<endl;
cout<<"Value must be between "<<L<< " and "<<H<<endl;
cin>>ent;
}
return(ent);
}
//==========================================================
void sign()
//说明作者
{
cout<<"This Program Was Written By Isaac Shaffer"<<endl;
}
//=============================================================
int random(long hi,long lo)
//这个程序过程中取的是随机数
{
int ran;
srand((unsigned)time(NULL));
ran=rand()%(hi-(lo-1))+lo;
return(ran);
}
//utility.h程序结束
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -