c++超简单程序,不知错在哪里?

来源:百度知道 编辑:UC知道 时间:2024/09/24 01:23:12
#include<iostream>
using namespace std;
#inlcude<string.h>
int main()
{
char a[10],b[10];
cin>>a>>b;
if(strlen(a)==strlen(b))
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
return 0;
}

#inlcude<string.h>
这个你拼错了,应该是include
你再试试
写程序,首先要学会调试啊,并看懂错误进行修改

错误信息是什么啊?

试过了,其他没问题,本程序第一行少.h无关紧要,但以后注意
第三行 应该为include

我个人认为有两个地方可能有问题。当然,由于我自己并没有调试运行你的程序,只是自己的经验而已。
第一:有可能是“<iostream.h>”加上“.h”。因为不知道你是用的什么软件,像visual2005和2008两个版本就不一样。有的需要“.h”,有的不需要
第二:程序的最后要加上"getchar();"以表示暂停。