蓝桥杯原题--核桃的数量
来源:互联网 发布:淘宝买家如何不评价 编辑:程序博客网 时间:2024/04/26 16:16
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <math.h>
using namespace std;
int gcd(int a,int b)
{
if(b==0)return a;
else return gcd(b,a%b);
}
int main()
{
int a,b,c,d;
while(cin>>a>>b>>c)
{
int sum;
d=gcd(a,b);
sum=a*b/d;
d=gcd(sum,c);
sum=sum*c/d;
cout<<sum<<endl;
}
return 0;
}
#include <iostream>
#include <algorithm>
#include <string.h>
#include <math.h>
using namespace std;
int gcd(int a,int b)
{
if(b==0)return a;
else return gcd(b,a%b);
}
int main()
{
int a,b,c,d;
while(cin>>a>>b>>c)
{
int sum;
d=gcd(a,b);
sum=a*b/d;
d=gcd(sum,c);
sum=sum*c/d;
cout<<sum<<endl;
}
return 0;
}
0 0
- 蓝桥杯原题--核桃的数量
- 核桃的数量
- 蓝桥杯 核桃的数量
- 蓝桥杯:核桃的数量
- 核桃的数量
- 核桃的数量
- 蓝桥杯:核桃的数量
- 33.核桃的数量
- 核桃的数量
- 核桃的数量
- 蓝桥杯 - 核桃的数量
- 核桃的数量
- NYOJ核桃的数量
- 蓝桥杯 核桃的数量
- 蓝桥杯:核桃的数量
- 核桃的数量
- 核桃的数量
- 核桃的数量
- hibernate 使用HQL语句进行多表联查
- Vue入门
- linux 搭建轻量级邮件服务器
- 怎么理解回调函数
- GDB下查看内存命令(x命令)
- 蓝桥杯原题--核桃的数量
- Python调用C/C++的种种方法
- base64编码算法与c语言实现
- Learning Deconvolution Network for Semantic Segmentation
- jrtplib 编译安装配置
- Dom4j中的中文编码问题
- $.ajax同步/异步(async:false/true)
- C++11-委托构造函数(新特性)
- pandas中的几个重要函数