[C++] 寻找数组元素 →→→→→进入此内容的聊天室

来自 , 2019-06-17, 写在 C++, 查看 133 次.
URL http://www.code666.cn/view/d4b2aeb2
  1. #include <algorithm>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int search_value,pause, ia[9]= {47,29,37,23,11,7, 5, 31, 41};
  6. void ff();
  7.  
  8. int main()
  9. {
  10.         while(1)
  11.                 ff();
  12.         return 0;
  13. }
  14.  
  15. void ff()
  16. {
  17.         cout<<"input a number you need search:"<<endl;
  18.         cin>>search_value;
  19.         int * presult = find(&ia[0],&ia[9],search_value);
  20.         cout<<"number "<<search_value<<(presult == &ia[9]? " yes ":" no")<<endl;
  21. }

回复 "寻找数组元素"

这儿你可以回复上面这条便签

captcha