设计函数fun,判断一对整数中第二个整数是否为第一个整数的倍数。要求定义fun如下: int fun(int,int);//满足条件返回1,否则返回0 在主函数中输入一系列整数对,并将是倍
#include<iostream>
using namespace std;
int fun(int, int);
int main()
{
int x,y;
while(1) {
cout<<"输入第1个数:";
cin>>x;
if(!x)break;
cout<<"输入第2个数: ";
cin>>y;
if(fun(x, y))cout<<x<<' t' <<y<<endl;
else cout<<"不满足条件! "<<endl ;cout<<endl;
}
system("pause");
return 0;
}
int fun(int m, int n)
{
if(n%m==0)return 1;else return 0;
}