#include <iostream>
int name;
int main(int argc, const char * argv[]) {
std::cout << "What's Your Name?"<< std::endl;
std::cin >> name;
std::string text = "Hi ";
std::cout << text << name << std::endl ;
return 0;
}
它只是输出:如何让我的代码输出输入的名称?
你叫什么名字?
王
嗨0
程序退出代码为结束:0
您未能检查输入操作的返回值。 –
将整个名称存储为整数?嗯... –
我该如何存储它? –