当前位置:网站首页>Zzuli: maximum Convention and minimum common multiple
Zzuli: maximum Convention and minimum common multiple
2022-07-02 05:29:00 【Don't explode】
Title Description
Enter two positive integers , Output its maximum common divisor and minimum common multiple .
Input
Enter two positive integers n and m(n,m<=1000000). Input to ensure that the final result is int Within the scope of .
Output
Output two integers , Space off . Express m and n The greatest common divisor and the least common multiple of .
The sample input Copy
4 6
Sample output Copy
2 12
Tips
Pay attention to the overflow problem in the operation process
#include <stdio.h>
int main()
{
int m,n,r,i,a,b;
scanf("%d%d",&m,&n);
a=n;
b=m;
while(m%n!=0)
{
r=m%n;
m=n;
n=r;
}
i=b/n*a;
printf("%d %d",n,i);
return 0;
}边栏推荐
猜你喜欢

指针使用详解

Pyechats 1.19 generate a web version of Baidu map

2022-2-15 learning xiangniuke project - Section 8 check login status

kmp思想及模板代码

Fabric. JS right click menu

Fabric.js 渐变
![Gee series: unit 9 generate sampling data in GEE [random sampling]](/img/ff/edb27b40f63eca81c5683e81b2860b.jpg)
Gee series: unit 9 generate sampling data in GEE [random sampling]

RNN recurrent neural network

Gee series: unit 6 building various remote sensing indexes in Google Earth engine

Visual studio import
随机推荐
2022-2-14 learning xiangniuke project - Section 7 account setting
Fabric. JS centered element
Fabric. JS basic brush
Global and Chinese market of insulin pens 2022-2028: Research Report on technology, participants, trends, market size and share
简单封装 js并应用
Gee: find the spatial distribution and corresponding time of the "greenest" in the Yellow River Basin in 2020 [pixel by pixel analysis]
Fabric.js IText设置指定文字的颜色和背景色
Small and medium-sized projects to achieve certification and authorization of hand filter
Gee: explore the characteristics of precipitation change in the Yellow River Basin in the past 10 years [pixel by pixel analysis]
Ls1046nfs mount file system
Visual Studio導入
el form 表单validate成功后没有执行逻辑
Importation de studio visuel
Fabric.js 激活输入框
Gee: remote sensing image composite and mosaic
Visual Studio导入
7.TCP的十一种状态集
Using QA band and bit mask in Google Earth engine
paddle: ValueError:quality setting only supported for ‘jpeg‘ compression
Feign realizes file uploading and downloading