• 第四次作业 刘惠惠


    public class Sum
    
    {
      public static void main(String[] args)
    
      {
        System.out.println("5+5="+5+5);
      }
    

    public class Increment
    {
      public static void main(String[] args)
      {
        int a=3,b;
        b=a++;
        System.out.println("a="+a+",b="+b);
      }
    }
    

     

    public class Short
    {
      public static void main(String[] args)
      {
        short s=3;
        s+=4;
        System.out.println("s="+s);
      }
    }
    

     

    public class Count
    {
      public static void main(String[] args)
      {
        System.out.println(6&3);
        System.out.println(6|3);
        System.out.println(6^3);
        System.out.println(6<<3);
        System.out.println(3<<2);
        System.out.println(3>>1);
      }
    }
    

     

    public class Countc
    {
      public static void main(String[] args)
      {
        int x=0,y;
        y=x>1?100:200;
        System.out.println("y="+y);
      }
    

     

    public class ComeputeA
    {
      public static void main(String[] args)
      {
        Scanner input=new Scanner(System.in);
        System.out.print("输入两个数:");
        int a=input.nextInt();
        int b=input.nextInt();
        a=a>b?a:b;
        System.out.println(a);
      }
    

     

    public class ComeputeB
    {
      public static void main(String[] args)
      {
        Scanner input=new Scanner(System.in);
        System.out.print("输入三个数:");
        int a=input.nextInt();
        int b=input.nextInt();
        int c=input.nextInt();
        a=a>b?a:b;
        c=a>c?a:c;
        System.out.println(c);
      }
    }
    

     

    public class WeekDay
    {
      public static void main(String[] args)
      {
        Scanner input=new Scanner(System.in);
        System.out.print("请输入一个一到七之间的数:");
        int weekday=input.nextInt();
        if(weekday==1)
        System.out.println("今天星期一");
        if(weekday==2)
        System.out.println("今天星期二");
        if(weekday==3)
        System.out.println("今天星期三");
        if(weekday==4)
        System.out.println("今天星期四");
        if(weekday==5)
        System.out.println("今天星期五");
        if(weekday==6)
        System.out.println("今天星期六");
        if(weekday==7)
        System.out.println("今天星期日"); 
      }
    }
    

     

    public class SeasonA
    {
      public static void main(String[] args)
      {
        Scanner input=new Scanner(System.in);
        System.out.println("请输入一个数:");
        int a=input.nextInt();
        switch(a)
        {
          case 1:
          case 2:
            System.out.println("冬天来了!");
            break;
          case 3:
          case 4:
          case 5:
            System.out.println("春天来了!");
            break;
          case 6:
          case 7:
          case 8:
            System.out.println("夏天来了!");
            break;
          case 9:
          case 10:
          case 11:
            System.out.println("秋天来了!");
            break;
          case 12:
            default:
            System.out.println("出错!");
          }
      }
    }
    

     

    public class Season
    {
      public static void main(String[] args)
      {
        Scanner input=new Scanner(System.in);
        System.out.print("输入一个月份:");
        int a=input.nextInt();
        if(a>=3&&a<=5)
          System.out.println("春天来了!");
        if(a>=6&&a<=8)
          System.out.println("夏天来了!");
        if(a>=9&&a<=11)
          System.out.println("秋天来了!");
        if(a>=12&&a<=2)
          System.out.println("冬天来了!");
      }
    }
    

     

  • 相关阅读:
    [linux内存]伙伴系统学习笔记(二)--内存系统初始化
    [linux内存]伙伴系统学习笔记(一)——概念
    Android 快速开发框架Afinal
    微信公众平台搭建
    Web Eclipse不识别HttpServlet
    Android 监听来电和去电状态
    Android 监听程序的安装和卸载
    Android 被忽略的UI检视利器:Hierarchy Viewer .
    Andriod 从源码的角度详解View,ViewGroup的Touch事件的分发机制
    Android 系统手机端抓包方法
  • 原文地址:https://www.cnblogs.com/huiiuh/p/7640600.html
Copyright © 2020-2023  润新知