首页 > 解决方案 > 为 C++ 设置的 VS 代码

问题描述

我是 VS 代码的新手。我编写了如下所示的 C++ 代码。但不幸的是,在终端或输出面板中,我无法同时获得字符串和变量值。在终端中仅显示变量的输入值。如何解决这个问题?

 #include <bits/stdc++.h>  

 int main() 
 {     
     int slices; 
     std::cin >> slices;
     std::cout << "You got " << slices << " of pizzas" << std::endl;
     return 0;
 }

在此处输入图像描述

标签: c++visual-c++vscode-settings

解决方案


推荐阅读