这题哪里错了啊??要最后输出:Hello,c++!

来源:百度知道 编辑:UC知道 时间:2024/06/24 01:39:22
#include <iostream.h>
void main()
{
int x,y,z,j;
x=hello;
y=',';
z='c++';
j='!';
cout<<"xyzj="<<endl;
}

#include <iostream.h>
void main()
{
char x,y,z,j;
x=hello;
y=',';
z='c++';
j='!';
cout<<"xyzj="<<endl;
}

//您太有才了,以下是修改后程序,注意双引号与单引号,还有cout的使用.
#include <iostream.h>
void main()
{
char x[10]="hello",y,z[10]="c++",j;
y=',';
j='!';
cout<<x<<y<<z<<j<<endl;
}
}

int 是整形
这里应该用string
x=hello----->这里都没有用“”
cout<<"xyzj="<<endl; ---〉这里用了引号,那么就不是输出变量,而是输出字符串~

//c++的应该这么写
#include <string>
#include <iostream>

using namespace std;
void main()
{
string x,y,z,j;
x="hello";
y=",";
z="c++";
j="!";
cout<<x+y+z+j<<endl;
}

#include <iostream.h>
void main()
{
int x