码迷,mamicode.com
首页 > 其他好文 > 详细

2020.3.26

时间:2020-03-26 12:28:24      阅读:30      评论:0      收藏:0      [点我收藏+]

标签:none   class   string   不能   无效   system   ann   java   public   

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.

2020.3.26

标签:none   class   string   不能   无效   system   ann   java   public   

原文地址:https://www.cnblogs.com/yyyyym/p/12573258.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有 京ICP备13008772号-2
迷上了代码!