首页 > 其他分享 >中奖

中奖

时间:2023-05-13 19:00:38浏览次数:19  
标签:std rand main int 中奖 include

#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

相关文章