- 复读机
可以给一下测试数据吗
- 2023-6-16 15:51:41 @
#include <bits/stdc++.h>
using namespace std;
void cmp(char a,char b,char x,char y){
int a1,b1,c1,d1;
char x1='<',x2='>',x3='=';
a1=a;
b1=x;
c1=b;
d1=y;
if(a1==b1){
if(c1==d1){
cout<<'='<<endl;
}
if(c1>d1){
cout<<x2<<endl;
}
if(c1<d1){
cout<<x1<<endl;
}
}
else
if(a1<b1){
cout<<x1<<endl;
}
else if(a1>b1){
cout<<x2<<endl;
}
}
int main(){
char x[100000],y[100000];
char g,t,w,p;
while(cin.getline(x,100000,' ')){
cin.getline(y,100000);
int i=0,j=0;
for(i;x[i]!='\0';i++){
}
for(j;y[j]!='\0';j++){
}
//cout<<i<<endl;
//cout<<j<<endl;
if(i<2){
//cout<<x[i-1]<<x[i-1]<<endl;
g=x[i-1];
t=x[i-1];
}
else{
//cout<<x[i-2]<<x[i-1]<<endl;
g=x[i-2];
t=x[i-1];
}
if(j<2){
//cout<<y[j-1]<<y[j-1]<<endl;
w=y[j-1];
p=y[j-1];
}
else{
//cout<<y[j-2]<<y[j-1]<<endl;
w=y[j-2];
p=y[j-1];
}
cmp(g,t,w,p);
}
return 0;
}
0 comments
No comments so far...
Information
- ID
- 21025
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 9
- Tags
- (None)
- # Submissions
- 25
- Accepted
- 3
- Uploaded By