1 solutions

  • 0
    @ 2025-11-5 19:00:34

    C++ :

    #include<iostream>
    using namespace std;
    int main()
    {
    	int m,n;
    	cin>>m>>n;
    	int r=m%n,t=m*n;
    	while (r)	//辗转相除法
    	{
    		m=n;
    		n=r;
    		r=m%n;
    	}
    	cout<<n<<" "<<t/n<<endl;
    	return 0;
    }
    
    • 1

    C语言程序设计教程(第三版)课后习题6.1

    Information

    ID
    19140
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    (None)
    # Submissions
    0
    Accepted
    0
    Uploaded By