题解
2025-08-16 12:17:02
发布于:浙江
2阅读
0回复
0点赞
#include<iostream>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
int m=a+b,n=c+d;
for(int i=0;i<3;i++){
int t;
cin>>t;
bool d1=false,d2=false;
for(int j=0;j<2;j++){
if(j==0){
int t1=t;
t1%=m;
if(t1>=1&&t1<=a)d1=true;
}else if(j==1){
int t1=t;
t1%=n;
if(t1>=1&&t1<=c)d2=true;
}
}
if(d1&&d2){
cout<<"both"<<endl;
}else if(d1||d2){
cout<<"one"<<endl;
}else cout<<"none"<<endl;
}
return 0;
}
这里空空如也
有帮助,赞一个