switch.cpp

来自「包含C++中map」· C++ 代码 · 共 27 行

CPP
27 行
字号
#include<iostream>

using namespace std;

int main()
{
	const char* msg_to_usr(int tries)
	{
		const int cnt=5;
		static const char* guess[cnt]=
		{
			"Go on ,please make a guess. ",
			"Oops, nice guess but not quite if.",
			"Hmm,sorry.try the third! ",
			"Ah,try the fourth please.",
			"Oh,the fourth time is wrong,too ."
		};
		if(tries<0)
			tries=0;
		else if(tries>=cnt)
			tries=cnt-1;
		return guess[tries];
	}
	return 0;
}

⌨️ 快捷键说明

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