【发布时间】:2023-04-02 20:35:01
【问题描述】:
我只是想知道我怎么能做到这一点。这是我想要的代码的 sn-p:
/**< CASPOR's question script */
if (input == "N")
{
cout << "Ok, " << name << " would you like to ask me a simple question?\n";
cin >> input;
{
if (input == "Y")
{
while ("Y")
{
cout << "Ask away!\n";
cin.ignore();
getline(cin, input);
{
if (input == "Who are you?")
{
cout << "I am CASPOR, or a C++ Automated Speech Program Of Recognition.\n";
}
if (input == "What is your purpose?")
{
cout << "My purpose is to entertain and amaze. Almost like a boredom breaker.\n";
}
if (input == "What can you do?")
{
cout << "I can do anything the developers program me to do!";
}
cout << "Would you like to ask another question?\n";
cin >> input;
{
if (input == "Y")
continue;
}
}
}
}
}
}
在"CASPOR" 回答你的问题的地方,我怎么能包括他每次都会说不同的话的机会?
【问题讨论】:
-
这个间距是怎么回事?使用任意缩进很难阅读您的代码。
标签: c++ random word code-snippets