2020.3.26

时间:2020-03-26
本文章向大家介绍2020.3.26,主要包括2020.3.26使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
package ifm;
import java.util.*;
public class ds {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner input = new Scanner(System.in);
        System.out.print("请输入分数:");
        int x = input.nextInt();
        int y = input.nextInt();
        int z = input.nextInt();
        System.out.print("请输入数字x:");
        System.out.print("请输入数字y:");
        System.out.print("请输入数字z:");
        if(x>y){x=x^y;
        y=x^y;
        x=x^y;
    }
    if(y>z){
        y=y^z;
        z=y^z;
        y=y^z;
    }
    if(x>y){
        x=x^y;
        y=x^y;
        x=x^y;
    }
    System.out.println(x + "<" + y + "<" + z);
        
    }

    }

 



package ifm;
import java.util.*;
public class ds {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner input = new Scanner(System.in);
        System.out.print("请输入分数:");
        int a = input.nextInt();
        if(a>=90 && a<=100){
            System.out.println("等级为A");
        }else if(a>=80 && a<=89){
            System.out.println("等级为B");
        }else if(a>=70 && a<=79){
            System.out.println("等级为C");
        }else if(a>=60 && a<=69){
            System.out.println("等级为D");
        }else if(a>=0 && a<=59){
            System.out.println("等级为E");
        }else{
            System.out.println("分数无效");
    }

    }
}

 

package ifm;
import java.util.*;
public class ifles {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
Scanner sc = new Scanner(System.in);
System.out.print("请输入一个数字:");
int x = sc.nextInt();
if(x % 5 == 0 && x % 6 == 0){
    System.out.println(x+"能被5和6整除");
}else if(x % 5 == 0){
    System.out.println(x+"能被5整除");
}else if(x % 6 == 0){
    System.out.println(x+"能被6整除");
}else{
    System.out.println(x+"不能被5或6整除");


}

    }

 

package ifm;
import java.util.*;
public class ifles {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
int x=input.nextInt();
if(x == 1){
    System.out.println("x="+x);
}    else if(x==5){
    System.out.println("x="+x);
}else if(x==10){
    System.out.println("x="+x);
}else;
System.out.println("x=none");
}
    

}

2.

$flag 上一页 下一页