永发信息网

C++中这段代码怎么用?

答案:4  悬赏:20  手机版
解决时间 2021-06-03 05:54
  • 提问者网友:孤凫
  • 2021-06-02 13:46

#include <iostream>
int main()

{

std::count << "Enter two numbers:" << std::endl;

int v1, v2

std::cin >> v1 >> v2;

std::count << "The sum of " << v1 << " and " << v2

<< " is " << v1 + v2 << std::endl;

return 0;

}

试了很多次都提示有错误

最佳答案
  • 五星知识达人网友:詩光轨車
  • 2021-06-02 15:21
你的cout打错了
全部回答
  • 1楼网友:舊物识亽
  • 2021-06-02 16:45

看看vc路径对不对

如果你是按照初始路径安装vc6.0的,路径应为: executatble files: C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin C:\Program Files\Microsoft Visual Studio\VC98\BIN C:\Program Files\Microsoft Visual Studio\Common\TOOLS C:\Program Files\Microsoft Visual Studio\Common\TOOLS\WINNT

include files: C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE

library files: C:\Program Files\Microsoft Visual Studio\VC98\LIB C:\Program Files\Microsoft Visual Studio\VC98\MFC\LIB

source files: C:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE C:\Program Files\Microsoft Visual Studio\VC98\CRT\SRC

  • 2楼网友:酒者煙囻
  • 2021-06-02 16:35
#include <iostream> int main() { std::cout << "Enter two numbers:" << std::endl; int v1, v2; std::cin >> v1 >> v2; std::cout << "The sum of " << v1 << " and " << v2 << " is " << v1 + v2 << std::endl; return 0; } cout写成count int v1, v2后面掉个分号 重起vc,或看把你进程里面还在运行着的同名exe关掉
  • 3楼网友:三千妖杀
  • 2021-06-02 16:14

#include<iostream>后打

using namespace std;

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯