1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#include <iostream>
#include <cmath>
#include <ctime>
#include <fstream>
#include <string>
using namespace std;
int main()
{
ifstream data1;
data1.open("C:\\Users\\Scott\\Downloads\\cards.txt");
string number[12], phrase[3];
int x, y, i;
getline(data1, phrase[0]);
getline(data1, phrase[1]);
getline(data1, phrase[2]);
getline(data1, phrase[3]);
getline(data1, number[0]);
getline(data1, number[1]);
getline(data1, number[2]);
getline(data1, number[3]);
getline(data1, number[4]);
getline(data1, number[5]);
getline(data1, number[6]);
getline(data1, number[7]);
getline(data1, number[8]);
getline(data1, number[9]);
getline(data1, number[10]);
getline(data1, number[11]);
getline(data1, number[12]);
srand((unsigned int)time(NULL));
x = rand() % 4;
y = rand() % 13;
for (i = 1; i < 6; i++)
{
x = rand() % 5;
cout << x << endl;
y = rand() % 14;
cout << y << endl;
cout << phrase[x];
}
return 0;
}
|