为类代码制作故事输出不对吗? [英] Making a story for class code not outputting right?

查看:47
本文介绍了为类代码制作故事输出不对吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在C ++课程的第一天,在网上,我得到了这样做,我做了这个故事的事情,如果我说不,那么我很难输出一些东西,如果我说是的话,就像一个选择,你们可以帮助我吗?

This is my first day in C++ class, online and I was given to do this and I made this story thing and I'm having a hard time with it outputting something if I say no and something if I say yes, like a choice, can you guys help me?

#include <iostream>

#include <string>

int main()
{
    using namespace std;
    
    cont << "Hello there travler, what is your name?!" << endl;
        string name;
        cin >> name;
    cont << name << "Why, what a wonderful name! Say, would you like to go on a quest for me!?"
    char yes;
         no;
         cin >> no;
         cin >> yes;   
         string yes;
         string no;
    cont << yes << "Well that's wonderful, go down to the village on the east side of the lake and help the villagers from the manslaughtering goblins!" << endl;
    cont << no << "Well that's a shame be gone then I have things to get done!" << endl;
    return 0;
}









我尝试了什么:



我尽可能多地搞乱它,但没有任何工作。



What I have tried:

I tried messing with it as much as I can but nothing is working.

推荐答案

以下是语言作者对C和C ++参考书的链接。注意,C是C ++的祖先,所以知道C对C ++总是有用。

C编程语言 - 维基百科,免费的百科全书 [ ^ ]

https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2。 pdf [ ^ ]

http://www.ime.usp。 br / ~pf / Kernighan-Ritchie / C-Programming-Ebook.pdf [ ^ ]



C ++编程语言 [ ^ ]
Here is links to references books on C and C++ by the authors of the languages. Note than C is the ancestor of C++, so knowing C is always useful with C++.
The C Programming Language - Wikipedia, the free encyclopedia[^]
https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf[^]
http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Ebook.pdf[^]

C++ Programing Language[^]


这篇关于为类代码制作故事输出不对吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆