acacacacacacacacacac
2023-12-30 19:14:04
发布于:广东
14阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int maxi(int a, int b){
int max_num = max(a, b);
return max_num;
}
int cmp(int m, int n){
if(m > n){
return 1;
}else if(m < n){
return 3;
}
}
int main(){
char a[100], b[100];
cin.getline(a, 100);
cin.getline(b, 100);
int lena = strlen(a);
int lenb = strlen(b);
int chan = maxi(lena, lenb);
for(int i = 0; i < chan; i++){
if((a[i] >= 'A' and a[i] <= 'Z') and (b[i] >= 'a' and b[i] <= 'z')){
b[i] -= 32;
if(cmp(a[i], b[i]) == 1){
cout << ">";
return 0;
}
if(cmp(a[i], b[i]) == 3){
cout << "<";
return 0;
}
}else if((a[i] >= 'a' and a[i] <= 'z') and (b[i] >= 'A' and b[i] <= 'Z')){
b[i] += 32;
if(cmp(a[i], b[i]) == 1){
cout << ">";
return 0;
}
if(cmp(a[i], b[i]) == 3){
cout << "<";
return 0;
}
}else{
if(cmp(a[i], b[i]) == 1){
cout << ">";
return 0;
}
if(cmp(a[i], b[i]) == 3){
cout << "<";
return 0;
}
}
}
cout << "=";
return 0;
}
这里空空如也
有帮助,赞一个