中奖

fushuxuan / 2023-05-13 / 原文

#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;
}