使用swap
C++ 代码
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
cin >> a;
cin >> b;
if(a < b)
swap(a,b);
c = a % b;
if(c == 0)
cout << "Sao Multiplos"<<endl;
else
cout << "Nao sao Multiplos" << endl;
return 0;
}