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、
真有意思…