64,639
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
while(a||b||c)
{
int temp;
while(a%b)
{
temp=b;
b=a%b;
a=temp;
}
if ( c%b == 0 )
{
cout<<"Yes"<<endl;
}
else
{
cout<<"No"<<endl;
}
cin>>a>>b>>c;
}
}
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
while(a||b||c)
{
if ( a* b ==0)
{
b = a+b;
}
else
{
int temp;
while(a%b)
{
temp=b;
b=a%b;
a=temp;
}
}
if ( b != 0 && c%b == 0 )
{
cout<<"Yes"<<endl;
}
else
{
cout<<"No"<<endl;
}
cin>>a>>b>>c;
}
}