• 二次上机 1804 张垚


    package ert;
    
    import java.util.*;
    
    public class l {
    		public static void main(String[] args){
    					System.out.println("输入变量x:");
    					Scanner input = new Scanner(System.in);
    					int x=input.nextInt();
    					if(x!=1&&x!=5&&x!=10){
    						System.out.println("x=none");
    					}else if(x==1){
    						System.out.println("x=1");
    					}else if(x==5){
    						System.out.println("x=5");
    					}else if(x==10){
    						System.out.println("x=10");
    					}
    				}
    
    			}
    		
    					 
    

      

    package ert;
    
    import java.util.*;
    
    public class l {
    		public static void main(String[] args){
    						System.out.println("请输入x的值:");
    						Scanner input=new Scanner(System.in);
    						int x=input.nextInt();
    						switch(x){
    						case 1: System.out.println("x=1"); break;
    						case 5: System.out.println("x=5"); break;
    						case 10:System.out.println("x=10"); break;
    						default:System.out.println("x=none"); 
    						}
    					}
    
    				}
    

      

    package ert;
    
    import java.util.*;
    
    public class l {
    		public static void main(String[] args){
    			
    					Scanner input = new Scanner(System.in);
    					System.out.println("输入数字:");
    					int a=input.nextInt();
    					if(a%5==0&&a%6==0){
    						System.out.println("可以被5,6整除");
    					}else if(a%5==0&&a%6!=0){
    						System.out.println("能被5整除");
    					}else if(a%5!=0&&a%6==0){
    						System.out.println("能被6整除");
    					}else if(a%5!=0&&a%6!=0){
    						System.out.println("不能被5,6整除");
    					}
    				}
    
    			}
    

      

    package ert;
    
    import java.util.*;
    
    public class l {
    	public static void main(String[] args) {
    		
    				System.out.println(" 输入分数:");
    				Scanner input = new Scanner(System.in);
    				int x=input.nextInt();
    				if(x<0||x>100){
    		            System.out.println("无效");
    		        }else if(x>=90){
    		            System.out.println("A");
    		        }else if(x>=80){
    		            System.out.println("B");
    		        }else if(x>=70){
    					System.out.println("C");
    				}else if(x>=60){
    					System.out.println("D");
    				}else if(x<60){
    					System.out.println("E");
    				}
    				
    		}
    		}
    

      

    package ert;
    
    import java.util.*;
    
    public class l {
    		public static void main(String[] args){
    		    Scanner sc=new Scanner(System.in);
    		    System.out.println("请输入三个整数:");
    		    int a=sc.nextInt();
    		    int b=sc.nextInt();
    		    int c=sc.nextInt();
    		    int d;
    		    if(a>b){
    		        d=b;
    		        b=a;
    		        a=d;
    		    }
    		    if(a>c){
    		        d=c;
    		        c=a;
    		        a=d;
    		    }
    		    if(b>c){
    		        d=c;
    		        c=b;
    		        b=d;
    		    }
    		    System.out.println(a+" "+b+" "+c);
    		}
    	}
    

      

     

  • 相关阅读:
    【HackerRank】Sherlock and MiniMax
    【HackerRank】Game Of Rotation
    【HackerRank】Bus Station
    【HackerRank】 有洞的地图
    【HackerRank】Sherlock and Array
    【HackerRank】QuickSort(稳定快排,空间复杂度O(n))
    【HackerRank】 The Full Counting Sort
    51获取6050原始数据并通过匿名上位机显示波形
    51单片机之IIC通信原理及软件仿真
    寻迹小车开发日记
  • 原文地址:https://www.cnblogs.com/ZXCVBNM1314/p/12574007.html
Copyright © 2020-2023  润新知