91 2 C:\Users\Administrator\Desktop\Untitled1.cpp [Error] 'cout' was not declared in this scope
时间: 2023-11-13 22:05:24 浏览: 199
这个错误通常表示在代码中使用了 cout
,但是没有包含相应的头文件。在 C++ 中,cout
是 iostream
头文件中定义的对象,因此需要在代码中包含该头文件。
你可以在代码开头添加下面这行代码,来包含 iostream
头文件:
#include <iostream>
这样就可以使用 cout
了。如果还有其他的头文件缺失,也需要添加相应的头文件来解决错误。