listtest4.cpp

来自「VC.net 的一些有用的技巧」· C++ 代码 · 共 19 行

CPP
19
字号
//ListTest4.cpp
#include <list>
#include <algorithm>
#include <iostream.h>
using namespace std ;
typedef list<int> LISTINT;
int main (void)
{
	LISTINT TestData;
	TestData.push_back(10);
	TestData.push_back(30);
	TestData.push_back(40);
	TestData.push_back(65);
	TestData.push_back(10);
	TestData.push_back(10);
	int result;
	result = count (TestData.begin(),TestData.end(), 10);
	cout << "10 appears " << result << " times in the TestData." << endl;
}

⌨️ 快捷键说明

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