2023-04-18 - 草稿

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        int score = scanner.nextInt();

       

        String result = score < 60 ? "不及格" : "通过了考试";

        System.out.println(result);

    }

}

import java.util.Scanner;


public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        int score = scanner.nextInt();

       

        if (score >= 90) {

            System.out.println("优秀");

        } else if (score >= 80) {

            System.out.println("优良");

        } else if (score >= 60) {

            System.out.println("中等");

        } else {

            System.out.println("不及格");

        }

    }

}

import java.util.Scanner;


public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        String signal = scanner.next();

       

        switch (signal) {

            case "红":

                // 根据路况情况,选择执行stop或go

                System.out.print("有交警吗?(输入y/n)");

                String police = scanner.next();

                switch (police) {

                    case "y":

                        System.out.println("stop");

                        break;

                    case "n":

                        System.out.println("go");

                        break;

                    default:

                        System.out.println("call police");

                        break;

                }

                break;

            case "绿":

                System.out.println("go");

                break;

            case "黄":

                System.out.println("wait");

                break;

            default:

                System.out.println("call police");

                break;

        }

    }

}

public class Main {

    public static void main(String[] args) {

        for (int i = 1; i <= 100; i++) {

            if (i % 5 == 0 && i % 6 == 0) {

                System.out.println(i);

            }

        }

    }

}

public class Main {

    public static void main(String[] args) {

        for (int i = 1; i <= 9; i++) { // 外层循环控制行数

            for (int j = 1; j <= i; j++) { // 内层循环控制每行的列数

                System.out.print(j + "*" + i + " = " + (i * j) + "  "); // 输出乘法表达式和结果

            }

            System.out.println(); // 每输出一行后,换行

        }

    }

}

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 2019年8月8日开始编写,等50题做完了希望不会太晚。 本篇纯属本人的练手作业,本人也不是什么大神,仅供参考。 ...
    墨鸢Wesley阅读 4,373评论 0 0
  • 1 顺序语句 语句:使用分号分隔的代码称作为一个语句。 注意:没有写任何代码只是一个分号的时候,也是一条语句,...
    哈哈哎呦喂阅读 3,060评论 0 0
  • 第一章 初识javaJAVA 第一讲:什么是程序?:为了让计算机执行某些操作或解决某个问题而编写的一系列有序指令的...
    人子日月几点阅读 3,561评论 0 1
  • Day01 class 例子{ public static void main(String[] args){ ...
    周书达阅读 4,855评论 0 0
  • 企业发放的奖金根据利润提成。利润低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万...
    辽A丶孙悟空阅读 4,292评论 0 16

友情链接更多精彩内容