运行有问题,找错
#include<iostream.h>void main()
{
char a[8],b[8];
int i=0,j=0;
cout<<"please input a:";
do
{
cin>>a[i];
}while(a[i]!='\n');
cout<<"please input b:";
do
{
cin>>b[i];
}while(b[i]!='\n');
if(a[0]==b[0])
cout<<"they are equal!"<<endl;
else if(a[0]=='r'&&b[0]=='s')
cout<<"the winner is a!"<<endl;
else if(a[0]=='r'&&b[0]=='c')
cout<<"the winner is b!"<<endl;
else if(a[0]=='c'&&b[0]=='s')
cout<<"the winner is b!"<<endl;
else if(a[0]=='c'&&b[0]=='r')
cout<<"the winner is a!"<<endl;
else if(a[0]=='s'&&b[0]=='r')
cout<<"the winner is b!"<<endl;
else if(a[0]=='s'&&b[0]=='c')
cout<<"the winner is a!"<<endl;
}
红色字输出不了,前面的赋值也不成功,求解释