locale-test/04.cpp

25 lines
295 B
C++
Raw Normal View History

2024-08-23 14:09:20 +08:00
#include<iostream.h>
int main()
{
int m,n,a,b,p,q;
cout<<"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>m,n:\n";
cin>>m>>n;
a=m;
b=n;
while(a%b!=0)
{
p=a%b;
a=b;
b=p;
}
for(q=1;q<=m*n;q++)
if((q%m==0)&&(q%n==0))
break;
cout<<"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<b<<endl;
cout<<"<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<q<<endl;
return 0;
}