当前位置:网站首页>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;
}
边栏推荐
- 7. Eleven state sets of TCP
- [technical notes-08]
- Gee data set: export the distribution and installed capacity of hydropower stations in the country to CSV table
- kmp思想及模板代码
- 青训营--数据库实操项目
- Financial portal related information
- Fabric. JS round brush
- 数据的储存
- Fabric.js IText 上标和下标
- Fabric. JS iText sets the color and background color of the specified text
猜你喜欢
【pyinstaller】_ get_ sysconfigdata_ name() missing 1 required positional argument: ‘check_ exists‘
Fabric. JS activation input box
Disable access to external entities in XML parsing
7. Eleven state sets of TCP
Using QA band and bit mask in Google Earth engine
在线音乐播放器app
centos8安裝mysql8.0.22教程
idea开发工具常用的插件合集汇总
6. Network - Foundation
Fabric. JS iText sets the color and background color of the specified text
随机推荐
Gee: use of common mask functions in remote sensing image processing [updatemask]
paddle: ValueError:quality setting only supported for ‘jpeg‘ compression
Online music player app
Fabric. JS iText sets the color and background color of the specified text
Principle and implementation of parallax effect
Ls1046nfs mount file system
操作符详解
Black Horse Notes - - set Series Collection
Gee dataset: chirps pentad high resolution global grid rainfall dataset
Disable access to external entities in XML parsing
Straighten elements (with transition animation)
视差特效的原理和实现方法
Importation de studio visuel
Fabric. JS iText superscript and subscript
Gee: find the spatial distribution and corresponding time of the "greenest" in the Yellow River Basin in 2020 [pixel by pixel analysis]
6. Network - Foundation
中小型项目手撸过滤器实现认证与授权
Collectors. Groupingby sort
centos8安装mysql8.0.22教程
No logic is executed after the El form is validated successfully