zoukankan      html  css  js  c++  java
  • Java条件语句练习

    /*System.out.println("请输入三个数字:");//输入三个数字,返回最大的那个。
    int a,b,c,big;
    Scanner d = new Scanner(System.in);
    a = d.nextInt();
    b = d.nextInt();
    c = d.nextInt();

    if(a>b)
    {
    big=a;
    if(big<c)
    {
    big = c;
    }

    }
    else
    {
    big=b;
    if(big<c)
    {
    big = c;
    }
    }
    System.out.println(big);*/
    /*
    System.out.println("请输入一元二次方程的三个系数");//一元二次方程根的情况

    double a,b,c,d;
    Scanner sc = new Scanner(System.in);
    a = sc.nextDouble();
    b = sc.nextDouble();
    c = sc.nextDouble();
    d = b*b-4*a*c;
    if(a==0)
    {
    System.out.println("这不是一个一元二次方程");
    }
    else
    {
    if(d>0)
    {
    System.out.println("方程有两个实根");
    }
    else if(d==0)
    {
    System.out.println("方程有两个相等的实根");
    }
    else
    {
    System.out.println("方程没有实根");
    }
    }
    */
    /*System.out.println("请输入一个年份");//输入一个年份看是否是闰年
    Scanner sc = new Scanner(System.in);
    int year = sc.nextInt();
    if(year%4 == 0 && year%100 != 0 || year%400 == 0)
    {
    System.out.println(year+"是闰年");
    }
    else
    {
    System.out.println(year+"不是闰年");
    }
    */
    /*System.out.println("输入性别:身高:体重:");//判断身材是否标准
    Scanner sc = new Scanner(System.in);
    String sex = sc.nextLine();
    double height = sc.nextDouble();
    double weight = sc.nextDouble();
    double biao;
    if(sex.equals("男"))
    {
    biao = height - 100;
    if(biao-3<height && biao+3>height)
    {
    System.out.println("good");
    }
    else if(biao-3>height)
    {
    System.out.println("thin");
    }
    else
    {
    System.out.println("fat");
    }
    }
    else if(sex.equals("女"))
    {
    biao = height - 110;
    if(biao-3<height && biao+3>height)
    {
    System.out.println("good");
    }
    else if(biao-3>height)
    {
    System.out.println("thin");
    }
    else
    {
    System.out.println("fat");
    }
    }

    */

  • 相关阅读:
    FastAPI框架
    bitmap去重与布隆过滤器
    MongoDB
    分布式爬虫
    scrapy 请求传参
    Scrapy 对接selenium
    Scrapy 去重源码分析
    [Python]网络小说爬取、爬虫
    学习进度报告【第八周】
    [opencv]图像处理-边缘检测
  • 原文地址:https://www.cnblogs.com/ermeng/p/6198436.html
Copyright © 2011-2022 走看看