c++_核桃的数量

#include <iostream> 
using namespace std;
    int gcd(int x,int y){
        int temp;
        while(y!=0){
            temp=x%y;
            x=y;
            y=temp;
        }
        return x;
    }
int main(){
int a,b,c;
cin>>a>>b>>c;
int temp=(a*b)/gcd(a,b);
int res=(temp*c)/gcd(temp,c);
cout<<res;
} 

 

posted on 2018-03-26 22:27  我吃你大西瓜  阅读(442)  评论(0编辑  收藏  举报

导航