核桃数量
来源:互联网 发布:淘宝药店旗舰店靠谱吗 编辑:程序博客网 时间:2024/04/27 03:23
public class hetaoshuliang {
static int yueshu(int a,int b){
int m,n,r;
if(a==b){
return a;
}
else{
if(a>b){
m=a;
n=b;
}
else{
m=b;
n=a;
}
r=m%n;
while(r!=0){
m=n;
n=r;
r=m%n;
}
return n;
}
}
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int a=input.nextInt();
int b=input.nextInt();
int c=input.nextInt();
int d=yueshu(a, b);
int e=yueshu(a, c);
int f=yueshu(c, b);
if((a==1&&b==1)||(a==1&&c==1)||(c==1&&b==1)){
System.out.println(a*b*c);
}
else{
if(d==e&&e==f){
System.out.println(a*b*c/(d*e));
}
else {
if((d!=e&&e!=f)){
System.out.println(a*b*c/(d*e*f));
}
if(d==e){
System.out.println(a*b*c/(d*f));
}
if(d==f){
System.out.println(a*b*c/(d*e));
}
if(e==f){
System.out.println(a*b*c/(d*e));
}
}
}
}
}
- 核桃数量
- 核桃的数量
- 蓝桥杯 核桃的数量
- 蓝桥杯:核桃的数量
- 核桃的数量
- 核桃的数量
- 蓝桥杯:核桃的数量
- 33.核桃的数量
- 核桃的数量
- 核桃的数量
- 蓝桥杯 - 核桃的数量
- 核桃的数量
- NYOJ核桃的数量
- 蓝桥杯 核桃的数量
- 蓝桥杯:核桃的数量
- 核桃的数量
- 核桃的数量
- 核桃的数量
- 模板--判断两线段是否相交
- Swift-AES之加密解密
- 分析C语言的声明的优先级
- 利用FormData,进行Ajax请求并上传文件
- 判断字符串是否为变形词
- 核桃数量
- 修改PE加载dll
- spring cloud:spring cloud config
- mybatis缓存的使用及理解
- Laravel Repository 模式
- python中socket【TCP】基本编程知识
- 界面编程与视图(view)组件——三种UI界面开发方式
- Android设计模式之建造者模式(Builder Pattern)
- 深入Java集合学习系列:HashMap的实现原理