Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- #include <iostream>
- #include <time.h>
- #include <vector>
- #include <algorithm>
- using namespace std;
- vector<int> intArray;
- //mySort fucntion for the sortVector function.
- bool mySort(int i, int j) {
- return (i < j);
- }
- //fill the vector with 100 random integers.
- vector<int> fillVector(vector<int> userInput) {
- vector<int> returnObject;
- for (int i = 0; i < 100; i++) {
- returnObject.push_back(rand() % 100);
- }
- return returnObject;
- }
- //sort the vector
- vector<int> sortVector(vector<int> userInput) {
- vector<int> returnObject;
- sort(userInput.begin(), userInput.end(), mySort);
- returnObject = userInput;
- return returnObject;
- }
- bool findRandomNumer(vector<int> userInput) {
- bool returnObject = false;
- int numberToFind = userInput[rand() % userInput.size()];
- int currentIndex, nextIndex;
- if (userInput.size() > 1) {
- nextIndex = userInput.size() / 2;
- }
- }
- void main() {
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment