拿去应付作业
查看原帖
拿去应付作业
1393632
jiake101201楼主2025/1/1 10:27
#include<bits/stdc++.h>//可改为include<iostream>
using namespace std;
int a,b,c,d,p[10];
string check(int x){
	if(0<x%(a+b)&&x%(a+b)<=a&&0<x%(c+d)&&x%(c+d)<=c){
		return "both";
	}
	if((x%(a+b)>a||x%(a+b)==0)&&(x%(c+d)>c||x%(c+d)==0)){
		return "none";
	}
	else{
		return "one";
	}
}
int main(){
	cin>>a>>b>>c>>d>>p[1]>>p[2]>>p[3];
	for(int i=1;i<=3;++i){
		cout<<check(p[i])<<endl;
	}
	return 0;
}//拿去应付作业
//原作者为@Scrutiny

原作者为@Scrutiny

2025/1/1 10:27
加载中...