c++ 运行不了 我的这个有什么问题呢?

来源:百度知道 编辑:UC知道 时间:2024/06/23 01:00:46
#include<iostream.h>
void hello(char*s)
{
cout<<endl<<s<<"请输入密码";
}
void main()
{
hello("密码正确");
hello("密码错误");
}

#include<iostream.h>
void hello(char*s)
{
cout<<endl<<s<<"请输入密码";
}
void main()
{
hello("密码正确");
hello("密码错误");
}

你用中了中文的“;”号了。输入法问题。

hello("密码正确");
hello("密码错误");
这两句后的标点符号是中文的,改成英文就行了,如下:

#include<iostream.h>
void hello(char*s)
{
cout<<endl<<s<<"请输入密码";
}
void main()
{
hello("密码正确");
hello("密码错误");
}

如果他们的方法不行,就试试在
#include <iostream.h>下面加上
using namespace std;

#include <iostream>
using namespace std;
int main()
{
return 0;
}