proj6_04.cpp

来自「C++程序设计教程的全部源代码 包含与教程同步的PPT 方便学习」· C++ 代码 · 共 19 行

CPP
19
字号
#include <algorithm>
#include <list>
#include <iostream.h>
using namespace std;

void main()
{
  	int search_value;
  	int ia[ 6 ] = { 27, 210, 12, 47, 109, 83 };
  	list<int> ilist( ia, ia+6 );
  	search_value = 20;
  	list<int>::iterator presult;
  	presult = find( ilist.begin(), ilist.end(), search_value );
	cout << "The value " << search_value
		<< (presult == ilist.end()
		? " is not present" : " is present" )
       		<< endl;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?