蒟蒻20分求助
查看原帖
蒟蒻20分求助
370425
SCP_基金会楼主2020/8/24 13:14

洛谷说我今天忌刷题,结果连刷几题都是WA

#include <iostream>
using namespace std;
int gcd1(int a,int b){
	if(b==0){
		return a;
	}
	return gcd1(b,a%b);
}
int gcd2(int c,int d){
	if(d==0){
		return c;
	}
	return gcd2(d,c%d);
}
int main(){
	int a,b,c,d,e,x,y,sum;
	cin>>x>>y;
	if(gcd1(a,b)==x){
		if(e=gcd2(c,d)&&c*d/e==y){
			sum++;
		}
	}
	cout<<sum;
	
	return 0;
}
2020/8/24 13:14
加载中...