最小公倍数

Posted leafbud

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了最小公倍数相关的知识,希望对你有一定的参考价值。

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>

int main(){
    int a, b; 
    
    scanf("%d%d", &a, &b);
    int bigger = a * b;
    int i;
    for (i = 1; i <= bigger; i++){

        if (i % a == 0 && i % b == 0){
            bigger = i;
            printf("%d
", bigger);
        }
    }
    system("pause");
    return 0;
}

 


 

以上是关于最小公倍数的主要内容,如果未能解决你的问题,请参考以下文章