Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdlib.h>
  3. #include<time.h>
  4.  
  5. using namespace std;
  6.  
  7. main()
  8. {
  9.    srand( time( NULL ) );
  10.    std::string t[10];
  11.  
  12.    t[0] = "a";
  13.    t[1] = "b";
  14.    t[2] = "c";
  15.    t[3] = "d";
  16.    t[4] = "e";
  17.    t[5] = "f";
  18.    t[6] = "g";
  19.    t[7] = "h";
  20.    t[8] = "i";
  21.    t[9] = "j";
  22.  
  23.  
  24.    int d=10;
  25.    int e;
  26.  
  27.    do
  28.    {
  29.         e = rand() % d;
  30.         cout << t[e] << endl << endl;
  31.  
  32.         for(int j=e; j<(d-1); j++)
  33.         {
  34.             t[j] = t[j+1];
  35.         }
  36.  
  37.         d--;
  38.    }while(d>0);
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement