Score
0
Watch 25 Star 104 Fork 12

Gitee星球的小活动 / 第 0 届 代码编故事接力赛

Join us
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
让我们点燃程序员写作之魂,一人用代码写一段故事玩玩吧~ spread retract

Clone or download
C++偷偷把公司的AI拿了出来 903 Bytes
Copy Edit Web IDE Raw Blame History
#include "stdafx.h"
#include <iostream>
using namespace std;
class CStupidHuman {
private:
char brainLanguageCenter[3][10] = {
"在吗?","会中文吗?","真的吗?"
};
public:
char* askQuestion(char _index)
{
return brainLanguageCenter[_index];
}
};
class CSmartAiRobot {
private:
char m_answer[20];
public:
char* thinkOnNeuralNetwork(char* _word)
{
char num = 0;
memset(m_answer, 0, 20);
while (_word[num++] != 0);
memcpy(m_answer, _word, num - 4);
*(m_answer + num - 4) = '!';
return m_answer;
}
};
int main()
{
CStupidHuman jerry;
CSmartAiRobot robot;
cout.imbue(locale("chs"));
char *word = nullptr;
for (int i = 0; i < 3; i++)
{
word = jerry.askQuestion(i);
cout << "jerry ask:" << word << endl;
word = robot.thinkOnNeuralNetwork(word);
cout << "Ai answer:" << word << endl;
}
system("pause");
return 0;
}

Comment ( 3 )

Sign in for post a comment

1
https://gitee.com/Selected-Activities/Code-relay.git
git@gitee.com:Selected-Activities/Code-relay.git
Selected-Activities
Code-relay
第 0 届 代码编故事接力赛
master

Help Search

220309 7019f5b6 1899542 220318 4015cbb9 1899542