形参为字符型数组的调用格式是怎样的
  • 板块学术版
  • 楼主乌丑
  • 当前回复7
  • 已保存回复7
  • 发布时间2021/9/17 19:39
  • 上次更新2023/11/4 06:32:37
查看原帖
形参为字符型数组的调用格式是怎样的
551130
乌丑楼主2021/9/17 19:39

RT

#include<bits/stdc++.h>
using namespace std;
int main() {
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	char c[105],d[105];
	fun(c,d);
	return 0;
}
int fun(char a[],char b[]) {
	char a[105],b[105];
	cin>>a>>b;
	if (strlen(a)!=strlen(b)) {
		cout<<"no"
		return 0;
	}
	for (int q=0; q<strlen(a); q++)
		if (a[q]!=b[q]) {
			cout<<"no"
			return 0;
		}
	cout<<yes;
	return 0;
}

哪里错了?(另外吐槽,连续十三个水贴

2021/9/17 19:39
加载中...