lrqSB @ 2024-08-21 09:47:14
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b,n=0;
cin >> a >> b;
for(int i=a;i<=b/2;i++){
for(int j=a;j<=b/2;j++){
if((i*j==a*b&&i%a==0&&j%a==0&&j%i!=0&&i%j!=0)){
n++;
}
}
}
cout<<n+2;
}
by lrqSB @ 2024-08-21 11:52:52
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b,n=0;
cin >> a >> b;
for(int i=a;i<=b/2;i++){
for(int j=a;j<=b/2;j++){
if((i*j==a*b&&i%a==0&&j%a==0&&j%i!=0&&i%j!=0)){
n++;
}
}
}
if(b%a==0){
n+=2;
}
cout<<n;
}
by lrqSB @ 2024-08-21 11:53:09
刚改了一下代码