刚学c++,照抄一点代码。怎么就老是出错呢?
#include<iostream>intshow(inta,intb){returna+b;}intmain(){inta,b;std::cout<<"qingshur...
#include<iostream>
int show(int a,int b)
{
return a+b;
}
int main()
{
int a,b;
std::cout<<"qingshuru ";
std::cin>>a;
atd::cin>>b;
atd::cout<<"a+b="<<show(a,b);
std::cout<<"main\n";
return 0;
}
D:\TDDownload\VC6\MyProjects\1\1.cpp(11) : error C2653: 'atd' : is not a class or namespace name
D:\TDDownload\VC6\MyProjects\1\1.cpp(11) : error C2065: 'cin' : undeclared identifier
D:\TDDownload\VC6\MyProjects\1\1.cpp(11) : warning C4552: '>>' : operator has no effect; expected operator with side-effect
D:\TDDownload\VC6\MyProjects\1\1.cpp(12) : error C2653: 'atd' : is not a class or namespace name
D:\TDDownload\VC6\MyProjects\1\1.cpp(12) : error C2065: 'cout' : undeclared identifier
D:\TDDownload\VC6\MyProjects\1\1.cpp(12) : error C2297: '<<' : illegal, right operand has type 'char [5]'
Error executing cl.exe.
1.exe - 5 error(s), 1 warning(s)
懂得 大神给我讲讲怎么看他这个提示哪里错了 。 展开
int show(int a,int b)
{
return a+b;
}
int main()
{
int a,b;
std::cout<<"qingshuru ";
std::cin>>a;
atd::cin>>b;
atd::cout<<"a+b="<<show(a,b);
std::cout<<"main\n";
return 0;
}
D:\TDDownload\VC6\MyProjects\1\1.cpp(11) : error C2653: 'atd' : is not a class or namespace name
D:\TDDownload\VC6\MyProjects\1\1.cpp(11) : error C2065: 'cin' : undeclared identifier
D:\TDDownload\VC6\MyProjects\1\1.cpp(11) : warning C4552: '>>' : operator has no effect; expected operator with side-effect
D:\TDDownload\VC6\MyProjects\1\1.cpp(12) : error C2653: 'atd' : is not a class or namespace name
D:\TDDownload\VC6\MyProjects\1\1.cpp(12) : error C2065: 'cout' : undeclared identifier
D:\TDDownload\VC6\MyProjects\1\1.cpp(12) : error C2297: '<<' : illegal, right operand has type 'char [5]'
Error executing cl.exe.
1.exe - 5 error(s), 1 warning(s)
懂得 大神给我讲讲怎么看他这个提示哪里错了 。 展开
2个回答
展开全部
#include<iostream>
int show(int a,int b)
{
return a+b;
}
int main()
{
int a,b;
std::cout<<"qingshuru ";
std::cin>>a;
std::cin>>b;//这里是std,你上面都写的std,这里为什么变成atd了呢??atd是错的
std::cout<<"a+b="<<show(a,b);//这里是std,你上面都写的std,这里为什么变成atd了呢??atd是错的
std::cout<<"main\n";
return 0;
}
追问
。。。万分感谢,请问下面提示里 c2653 2605都是什么 怎么找。能教教我么 ?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询