第二次java上机

import java.util.*;
public class fff{
public static void main(String args[]){
Scanner in=new Scanner(System.in);
int a=in.nextInt();
switch(a){
case 1:
case 5:
case 10:
System.out.println("x="+a);break;
default:System.out.println("x=none");
}
}
}

 

import java.util.*;  
pubilc class fff{
public static void main(String[] args) { System.out.println("请输入一个数"); Scanner input = new Scanner(System.in); int x=input.nextInt(); if (x/6==0&&x/5==0){ System.out.println("x="+x); } else if (x/5==0){ System.out.println("x="+x); } else if (x/6==0){ System.out.println("x="+x); } else if (x/5!=0&&x/6!=10){ System.out.println("x="+x); } else { System.out.println("none"); } }
import java.util.*;
public class fff{
public
static viod main(String[] args) System.out.println("输入一个1—100的数字"); Scanner input=new Scanner(System.in); int a=in.nextlnt(); if 90<a<100 println("a"); if 80<a<89 println("b"); if 70<a<79 println("c"); if 60<a<69 println("d"); if a<59 println("e"); else if println("null"); default:System.out.println("null"); } }
import java.util.*;

public class fff{
 
    public static void main(String[] args) {
         TODO Auto-generated method stub
        int x=0,y=0,z=0;
        Scanner sc=new Scanner(System.in);
        x=sc.nextInt();
        y=sc.nextInt();
        z=sc.nextInt();
        int j;
        if(x>y){
            j=y;
            y=x;
            x=j;
        }
        if(x>z){
            j=z;
            z=x;
            x=j;
        }
        if(y>z){
            j=z;
            z=y;
            y=j;
        }
        System.out.println(x+" "+y+" "+z);
    }
}

 

 

posted @ 2020-03-26 12:11  啪啪怪  阅读(217)  评论(0编辑  收藏  举报