让我“虎躯一震”的人工智能代码

1、

在知乎上看到的“让人虎躯一震”的代码,写来和大家分享下
代码简单的很,内容很有趣,结果感觉是那么回事,不知道的真的被骗了…
超级智能计算机

2、代码

#include <iostream>
#include "string"
#include "algorithm"
using namespace std;


void SmartFun()
{
	string s;
	int index;
	cin >> s;
	index = s.find("吗?", 0);
	if (index != string::npos)
	{
		s = s.replace(index, 3, "!");
	}
	cout << "电脑:" << s << endl;
}

int main(void)
{
	while (1)
	{
		SmartFun();
	}
	system("pause");
	return 0;
}


3、

真有意思…

发布了46 篇原创文章 · 获赞 13 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_42718004/article/details/85058575