SHARE
TWEET

Untitled

a guest Sep 17th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. int bsearch(int a[],int x)
  4. {
  5.     for (int i = 0; i < 50; i++)
  6.         if (a[i] < x)
  7.         {
  8.             std::cout << i;
  9.             break;
  10.         }
  11.     return 0;
  12. }
  13. void main()
  14. {
  15.     int b[50], i, n,k=50;
  16.  
  17.     for (i = 0; i < 50; i++)
  18.     {
  19.         b[i]=k;
  20.         k--;
  21.     }
  22.     std::cin >> n;
  23.     bsearch(b,n);
  24.    
  25.     system("pause");
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top