BHXSpecter

This is what happens when I'm bored.

Aug 23rd, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.48 KB | None | 0 0
  1. #include <vector>
  2. #include <iostream>
  3. #include <algorithm>
  4. #include <cstdlib>
  5. #include <ctime>
  6. #include <string>
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11. {
  12.     srand(time(NULL));
  13.     vector<int> num;
  14.     vector<string> vocab;
  15.     for (int b = 0; b <= 20; b++)
  16.     {
  17.         cout << b << ' ';
  18.     }
  19.     cout << endl;
  20.     for (int i = 0; i <= 20; i++)
  21.     {
  22.         num.push_back(rand() % 101);
  23.     }
  24.    
  25.     for (int j = 0; j <= 20; j++)
  26.     {
  27.         cout << num[j] << ' ';
  28.     }
  29.     cout << endl;
  30.     sort(num.begin(), num.end());
  31.    
  32.     for (int k = 0; k <= 20; k++)
  33.     {
  34.         cout << num[k] << ' ';
  35.     }
  36.     cout << endl;
  37.     vocab.push_back("deck");  // 0
  38.     vocab.push_back("zebra"); // 1
  39.     vocab.push_back("arkham"); // 2
  40.     vocab.push_back("batman"); // 3
  41.     vocab.push_back("robin"); // 4
  42.     vocab.push_back("catwoman"); // 5
  43.     vocab.push_back("superman"); // 6
  44.     vocab.push_back("canary"); // 7
  45.     vocab.push_back("spiderman"); // 8
  46.     vocab.push_back("vulture"); // 9
  47.     vocab.push_back("crow"); // 10
  48.     vocab.push_back("wind"); // 11
  49.     vocab.push_back("earth"); // 12
  50.     vocab.push_back("fire"); // 13
  51.     vocab.push_back("water"); // 14
  52.     vocab.push_back("names"); // 15
  53.     vocab.push_back("dates"); // 16
  54.     vocab.push_back("times"); // 17
  55.     vocab.push_back("life"); // 18
  56.     vocab.push_back("love"); // 19
  57.     vocab.push_back("confidence"); // 20
  58.    
  59.     for (int l = 0; l <= 20; l++)
  60.     {
  61.         cout << vocab[l] << ' ';
  62.     }
  63.     cout << endl;
  64.     sort(vocab.begin(), vocab.end());
  65.     for(int m = 0; m <= 20; m++)
  66.     {
  67.         cout << vocab[m] << ' ';
  68.     }
  69.     cout << endl;
  70.     return 0;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment