#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char** argv) { srand(time(0)); int x=rand()%5+1; int y; cin>>y; if(y==x){ cout<<"中奖了"; }else{ cout<<"没中奖,中奖号码是:"<<x; } return 0; }
标签:std,rand,main,int,中奖,include From: https://www.cnblogs.com/fushuxuan/p/17397948.html