Guest User

Untitled

a guest
Apr 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <windows.h>
  5. using namespace std;
  6.  
  7. int main(){
  8. string* card[]={"P2","P3","P4","P5","P6","P7","P8","P9","P10","P_J","P_Q","P_K","P_A",
  9. "H2","H3","H4","H5","H6","H7","H8","H9","H10","H_J","H_Q","H_K","H_A",
  10. "K2","K3","K4","K5","K6","K7","K8","K9","K10","K_J","K_Q","K_K","K_A"};
  11. int n=1;
  12. int c;
  13. srand(time(0));
  14.  
  15. // for (int i=0; i<78; i++) { //unos brojeva od 1-78 u polje
  16. // card[i] = i;
  17. // }
  18.  
  19. for (int i=0; i<52; i++) {
  20. int r = rand() % 52; //miješa brojeve u polju
  21. string temp = card[i]; card[i] = card[r];
  22. }
  23. for(c=0;c<n;c++){
  24. cout<<card[c];
  25. }
  26. system("pause");
  27. return 0;
  28. }
Add Comment
Please, Sign In to add comment