小编ssl*_*pie的帖子

std :: cout << x之间的差异是什么?和std :: cout << x << std :: endl;?

我是编程的新手,我昨天开始自学,我已经得到了所有东西,但老实说,我不明白它们之间的区别

std::cout << x;
Run Code Online (Sandbox Code Playgroud)

std::cout << x << std::endl;
Run Code Online (Sandbox Code Playgroud)

没有人向我解释这一点,我要求保持安全.

c++

4
推荐指数
1
解决办法
1268
查看次数

C++ if/else语句问题

我前几天正在使用xcode,正在开发基于文本的对话游戏.

#include <iostream>

int main()
{
    std::cout<<"Conversation simulator requires you to type in all caps for all  of your replies"<<std::endl;
    std::cout<<"Type your first and last name!"<<std::endl;
    std::string fname = " ";
    std::string lname = " ";
    bool samename = false;
    std::cin>> fname >> lname ;
    if  (fname == "MUSCLE" and lname == "MAN")
        std::cout<< "Wow, we have the same first and last name!"<<std::endl;
        samename = true;
    else
        std::cout<< fname << " "<< lname << "is a very nice name"<<std::endl;

return …
Run Code Online (Sandbox Code Playgroud)

c++ xcode if-statement c++11

0
推荐指数
2
解决办法
365
查看次数

标签 统计

c++ ×2

c++11 ×1

if-statement ×1

xcode ×1