求助dev c++ cin does not name a type 怎么办?

2025年03月12日 20:44
有5个网友回答
网友(1):

头文件  iostream 要引入

名字空间 std 要引入,并且不能有冲突的命名。

 

推荐这么写

#include 

ret_type foo(arg_type arg ...)
{
    ...
    std::cin<    ...  
}

网友(2):

建议您这个样子改

#include
using namespace std;
int a,b;
double c;
int main(){
cin>>a>>b>>c;
........
}

网友(3):

当报告的错误为“

cin does not name a type

”时:

   1. 可能int main主函数的大括号没有打全

    2.可能没有引入头文件

    3.可能没有“std”

    4.可能变量的名字重复了

网友(4):

发你的代码看看

网友(5):

求源代码,我再给你看看