package work6;
public class Dwork1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int big=1;
while(big<100){
if((big*3+(100-big)/3)==100)
System.out.println("大动物的数量为:"+big+",小动物的数量为:"+(100-big));
big++;
}
}
}
package work6;
import java.util.Scanner;
public class Dwork2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int min;
Scanner sc=new Scanner(System.in);
System.out.print("请输入第一只骆驼的年龄:");
int m=sc.nextInt();
System.out.print("请输入第二只骆驼的年龄:");
int n=sc.nextInt();
min=m*n;
if(m<n)
{
int temp=m;
m=n;
n=temp;
}
while(n!=0)
{
int t=m%n;
m=n;
n=t;
}
min=min/m;
System.out.print("它们年龄的最小公倍数为:"+min);
}
}
package work6;
import java.util.Scanner;
public class Dwork3 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
System.out.println("请输入三角形的三条边长(小于1000):");
int A=sc.nextInt();
int B=sc.nextInt();
int C=sc.nextInt();
if(A>1000||B>1000||C>1000) {
System.out.println("请输入小于1000的数据");
}
else
{
if((A+B)>=C&&(A+C)>=B&&(B+C)>=A)
System.out.println("YES");
else
System.out.println("NO");
}
}
}