⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chat.h

📁 Basicaly,a chatterbot is a computer program that when you provide it with some inputs in Natural Lan
💻 H
字号:
// Program Name: chatterbot1
// Description: this is a very basic example of a chatterbot program
//
// Author: Gonzales Cenelia
//

#include <iostream>
#include <string>
#include <ctime>

int main()
{
	std::string Response[] = {
		"I HEARD YOU!",
		"SO,YOU ARE TALKING TO ME.",
		"CONTINUE,I'M LISTENING.",
		"VERY INTERESTING CONVERSATION.",
		"TELL ME MORE..."
	};

	srand((unsigned) time(NULL));

	std::string sInput = "";
	std::string sResponse = "";

	while(1) {
		std::cout << ">";
		std::getline(std::cin, sInput);
		int nSelection = rand() % 5;
		sResponse = Response[nSelection];
		if(sInput == "bye") {
			std::cout << "IT WAS NICE TALKING TO YOU USER, SEE YOU NEXT TIME!" << std::endl;
			break;
		}
		std::cout << sResponse << std::endl;
	}

	return 0;
}

⌨️ 快捷键说明

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