#include<iostream>
using namespace std;
//求两个数的最大公约数
int max_common_divisor(int a,int b)
{
int t;
if(a<b)
{
t=a;a=b;b=t;
}
t=a%b;
while(t!=0)
{
a=b;b=t;t=a%b;
}
return b;
}
int main()
{
int m,n,c,Big;
cout<<"Input m,n:";
int flag=1;
while(flag)
{
cin>>m>>n;
c=m*n;
if(c==0)
cout<<m<<"and"<<n<<"has no common divisor.Please input again!\n";
else if(c<0||(m<0&&n<0))
cout<<"this is not what we want!Please input again!\n";
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载