一、问题及代码

#include <iostream>
using namespace std;
int main()
{  char a[5],b[5],c[10];
int i,j;
cin>>a;
cin>>b;
for(i=0;a[i]!='\0'&&b[i]!='\0';i++)
if(a[i]!=b[i]) break;
j=a[i]-b[i];
if(j==0)
cout<<"相等"<<endl;
else cout<<"不相等"<<endl;
for(i=0;i<5;i++)
c[i]=a[i],c[i+5]=b[i];
cout.write(c,10);
 return 0;
}

二、运行结果:

C++第6次作业

相关文章:

  • 2022-01-06
  • 2021-12-24
  • 2021-08-16
  • 2021-12-13
  • 2021-12-24
  • 2021-04-06
猜你喜欢
  • 2022-01-30
  • 2021-11-08
  • 2021-12-06
  • 2021-06-28
相关资源
相似解决方案