判断语句
1.打印:--------------------------------------------------
2.求两个浮点数之商。
3.对一个数四舍五入取整。
4.判断一个数是否为奇数
5.求一个数的绝对值。
6.求两个数的最大值。
7.求三个数的最大值。
import java.util.Scanner;
public class Test1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
// 1 putLine();
// 2 double re=CF(3,2);
// System.out.println(re);
// 3 int re=(int) numberQZ(9.567);
// System.out.println(re);
// 4 Scanner sr=new Scanner(System.in);
// System.out.println("请输入一个数:");
// int re=sr.nextInt();
// OS(re);
// System.out.println(re);
// 5 int re=absoluteValue(-11);
// System.out.println("这个数的绝对值:"+re);
// 6 int re=getMax(9,6);
// System.out.println("两个数的最大值:"+re);
// 7 int re=getMaxes(11,6,10);
// System.out.println("三个数的最大值:"+re);
}
private static int numerQZ() {
// TODO Auto-generated method stub
return 0;
}
private static double getdouble(int i, int j) {
// TODO Auto-generated method stub
return 0;
}
public static void putLine(){
System.out.println("---------------------------");
}
public static double CF(double a,double b){
double c=a/b;
return c;
}
public static double numberQZ(double a){
double b=a+0.5;
int c=(int)b;
return c;
}
public static int OS(int a){
if (a%2==0){
System.out.println("不是奇数");
}else{
System.out.println("奇数");
}
return a;
}
public static int absoluteValue(int a){
int b;
if (a>=0){
b=a;
}else{
b=-a;
}
return b;
}
public static int getMax(int a,int b){
int c;
if (a>b){
c=a;
}else{
c=b;
}
return c;
}
public static int getMaxes(int a,int b,int c){
int d;
int max;
if (a>b){
d=a;
}else{
d=b;
}
if (d>c){
max=d;
}else{
max=c;
}
return max;
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)