函数版题解
2026-10-07 15:05:50
发布于:上海
0阅读
0回复
0点赞
定义函数,函数内判断,主程序内调用就行了
#include <bits/stdc++.h>
using namespace std;
bool pal(int a,int b)
{
if(max(a,b)==a) return 1;
else return 0;
}
int main()
{
int a,b;
cin>>a>>b;
if(pal(a,b)==1) cout << "YES";
else cout << "NO";
return 0;
}
这里空空如也





有帮助,赞一个