#include <bits/stdc++.h>
using namespace std;
int main()
{
char t=
1;
while(
1)
{
int left;
int right;
cout<<
"请输入您需要的左右边界:\n";
cin>>left>>right;
if(left>=right)
{
cout<<
"您的是输入数据不合法,请重新输入.\n";
continue;
}
srand( (
unsigned)time(NULL) );
int num=rand()%right + left;
while(!(num>= left && num<=right))
{
srand( (
unsigned)time(NULL) );
}
cout<<
"幸运听众的编号 "<<num<<endl;
cout<<
"是否继续运行?1:0\n";
cin>>t;
if(t==
'0')
{
cout<<
"欢迎下次使用!\n";
break;
}
else if(t==
'1');
else
{
cout<<
"孙子你找死啊!!!!!"<<endl;
break;
}
}
return 0;
}
转载请注明原文地址: https://ju.6miu.com/read-8975.html