Skip to content

ex5

← Back

Basic Info

Computer Programming 1
└── Lecture 13 LAB Exercises on Functions
    └── ex5.cpp

Preview

using namespace std;
#include <iostream>

int main(){
    srand(time(NULL));
    int r = rand()%6+1;
    cout << ((r>rand()%6+12)?"Player 1 wins!":"Player 2 wins!") << endl;

    return 0;
}