ch11counter.cpp

来自「此例子是学习C++的好东西」· C++ 代码 · 共 23 行

CPP
23
字号
//Program 11-1 Counter   Sample program with a counter object

//File: Ch11Counter.cpp

#include "Ch11Counter.h"
#include <iostream.h>

int main()
{
	Counter HowMany;    // constructor sets HowMany count = 0
	cout << "\n Sample program with class Counter  \n";
	HowMany.PrintCount();
	cout << "\n Increment HowMany twice: ";
	++HowMany;
	++HowMany;
	HowMany.PrintCount();
	cout << "\n Now set the count back to zero. ";
	HowMany.SetCount(0);  // set count value back to zero
	HowMany.PrintCount();
	cout << "\n\n All finished counting! \n";
	return 0;
}

⌨️ 快捷键说明

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