美国十大av男演员:编了一个C++程序不知错在哪了

来源:百度文库 编辑:高校问答 时间:2024/05/12 15:34:08
#include<iostream.h>
#include<math.h>
void main ()
{
int a,b,c,l;
cout<<"qing shu ru san bian bian chang ."<<endl;
cin>>a,b,c;
l=a+b+c;

cout<<"l="<<l<<endl;
}
cin>>a>>b>>c;这个对了
但是为什么下面这个不对呢?
cin>>a>>','>>b>>','>>c;
系统指错:

no operator defined which takes a right-hand operand of type 'const char' (or there is no acceptable conversion)

大哥了,你那里不能那样做输入~!
cout<<"qing shu ru san bian bian chang ."<<endl;
cin>>a,b,c; //这句用法不对
l=a+b+c;

应该这样用

cin>>a>>b>>c;

cin>>a>>','>>b>>','>>c;

我上面写的加常量,号的我也忘记对不对了,我很久没有用过C++时期的函数库了,你应该多练习,不对的时候仔细看程序多改改

math.h也可以不要,如果没有其他函数的情况下