suggestions on binary_search.cpp 

There's no bug here, but I'll give my personal suggestions on the code:
1.  in the while scope, you compare a[mid]==target, if the number of array a is very large, a = 10000 for example, most of time the boolean value a[mid]==target is false, I suggest that if(a[mid]==target) locates at last might be better, it will reduce judge times.
2. if(a[mid] > target), r= mid. Here, why not r= mid -1?