Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- #include <windows.h>
- using namespace std;
- int main(){
- string* card[]={"P2","P3","P4","P5","P6","P7","P8","P9","P10","P_J","P_Q","P_K","P_A",
- "H2","H3","H4","H5","H6","H7","H8","H9","H10","H_J","H_Q","H_K","H_A",
- "K2","K3","K4","K5","K6","K7","K8","K9","K10","K_J","K_Q","K_K","K_A"};
- int n=1;
- int c;
- srand(time(0));
- // for (int i=0; i<78; i++) { //unos brojeva od 1-78 u polje
- // card[i] = i;
- // }
- for (int i=0; i<52; i++) {
- int r = rand() % 52; //miješa brojeve u polju
- string temp = card[i]; card[i] = card[r];
- }
- for(c=0;c<n;c++){
- cout<<card[c];
- }
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment