#35100: 為什麼95%啊???


LEO960825 (())

學校 : 明新科技大學
編號 : 196357
來源 : [220.129.155.111]
最後登入時間 :
2025-09-27 18:41:19

#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b){
if(a%b==0){
cout<<"YES"<<endl;
}
else if(a==b){
cout<<"YES"<<endl;
}
else{
int c=a%b;
if(b%2==0){
c*=10000000;
if(c%b==0){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
 
 
 
else{
if(c%b==0){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
}
}
}
#35132: Re: 為什麼95%啊???


LEO960825 (())

學校 : 明新科技大學
編號 : 196357
來源 : [220.129.155.111]
最後登入時間 :
2025-09-27 18:41:19

#include
using namespace std;
int main(){
int a,b;
while(cin>>a>>b){
if(a%b==0){
cout<<"YES"<
}
else if(a==b){
cout<<"YES"<
}
else{
int c=a%b;
if(b%2==0){
c*=10000000;
if(c%b==0){
cout<<"YES"<
}
else{
cout<<"NO"<
}
}
 
 
 
else{
if(c%b==0){
cout<<"YES"<
}
else{
cout<<"NO"<
}
}
}
}
}

誰可以幫幫我😭😭

#35138: Re: 為什麼95%啊???


liaoweichen1024@gmail.com (M_SQRT)

學校 : 新北市立新莊高級中學
編號 : 195452
來源 : [140.114.123.98]
最後登入時間 :
2025-09-24 19:10:46

 

 

抱歉,真的沒看懂這支程式的邏輯,不知道怎麼改。 (a==b那個可以拿掉,如果a==b則a%b就會是0了)
但我能提供你幾個這支程式會答錯的測資:

23 3
YES

10162 4
NO

92558 5
YES

2147117569 6
YES

#35141: Re: 為什麼95%啊???


LEO960825 (())

學校 : 明新科技大學
編號 : 196357
來源 : [220.129.155.111]
最後登入時間 :
2025-09-27 18:41:19

 

 

抱歉,真的沒看懂這支程式的邏輯,不知道怎麼改。 (a==b那個可以拿掉,如果a==b則a%b就會是0了)
但我能提供你幾個這支程式會答錯的測資:

23 3
YES

10162 4
NO

92558 5
YES

2147117569 6
YES

對不起🧎‍♂️ 沒有仔細讀題目,讓我以為只要那個數字可以被除的進就是幸運數字了😐