Guest User

Untitled

a guest
Feb 5th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. bool findp(const std::vector<int> &f, int num) {
  2. int size = f.size();
  3.  
  4. for (int i = 0; i < size; i++) {
  5. int j = i+1;
  6. while (j < size) {
  7. if (f[i] + f[j] == num) {
  8. std::cout << "i: " << i << " j: " << j << std::endl;
  9. return true;
  10. }
  11. else {
  12. j++;
  13. }
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment