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

2025-03-12 20:44:45
推荐回答(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:

求源代码,我再给你看看