Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Cho 2 so nguyen duong a va b, hay tim boi so chung nho nhat
- // Khai bao thu vien
- #include<stdio.h>
- #include<conio.h>
- int UCLN(int a,int b);
- void main()
- {
- int a,b;
- scanf("%d%d",&a,&b);
- printf("%d", (a*b)/(UCLN(a,b)));
- }
- int UCLN(int a,int b)
- {
- while(a!=b)
- {
- if(a>b)
- {
- a=a-b;
- }
- else
- {
- b=b-a;
- }
- }
- return a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement