编辑代码

#include <iostream>
using namespace std;
int main() 
{
    int p,r,n,m,temp;
    cout<<"please enter two positive integer numbers n,m:";
    cin>>n>>m;
    if(n>m)	 	

       {temp=n; 
        n=m; 
        m=temp;
       }

p=n*m;

while(m!=0)

{r=n%m;
n=m;
m=r;

}

cout<<"HCF"<<n<<endl; 

cout<<"LCD"<<p/n<<endl; 

return 0;
}

    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。