Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 0; i < size; i++)
- {
- cin >> array[i];
- }
- int k;
- cin >> k;
- int asd;
- for (int i = 0; i < k ; ++i) {
- value = 0;
- cin >> key;
- index = Search_Binary (array, 0, size, key);
- for (int j = 0; j < size; ++j) {
- if (array[index] == array[index+1]){
- value++;
- }
- }
- if (value == 0){
- value = -1;
- }
- cout << index << " " << value;
- cout << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement