From 22318797f2d27df6775fda45dab1fe50bb7b84b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E4=BA=A8=E4=BC=9F?= <529310475@qq.com> Date: Tue, 29 Nov 2022 21:37:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=AC=A1=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20221129_Java\350\257\255\346\263\225.md" | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 "11 \351\202\271\344\272\250\344\274\237/20221129_Java\350\257\255\346\263\225.md" diff --git "a/11 \351\202\271\344\272\250\344\274\237/20221129_Java\350\257\255\346\263\225.md" "b/11 \351\202\271\344\272\250\344\274\237/20221129_Java\350\257\255\346\263\225.md" new file mode 100644 index 0000000..b091319 --- /dev/null +++ "b/11 \351\202\271\344\272\250\344\274\237/20221129_Java\350\257\255\346\263\225.md" @@ -0,0 +1,34 @@ +判断四位数 +import java.util.Scanner; + +public class banfuan { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + System.out.println("请输入一个四位数"); + int number = sc.nextInt(); + System.out.print(number+"这个数的千位数字是:"); + System.out.println(number/1000); + System.out.print(number+"这个数的百位数字是:"); + System.out.println(number%1000/100); + System.out.print(number+"这个数的十位数字是:"); + System.out.println(number%1000%100/10); + System.out.print(number+"这个数的个位数字是:"); + System.out.println(number%1000%100%10); + +温度转换 + +import java.util.Scanner; + +public class wendu { + public static void main(String[] args) { + Scanner Sc = new Scanner(System.in); + System.out.println("请输入温度"); + int wendu = Sc.nextInt(); + System.out.println((wendu-32)*5/9); + System.out.print("转化成摄氏度是"+ wendu); + System.out.println(wendu*9/5+32); + System.out.print("转化成华氏度是"+ wendu); + + + } +} \ No newline at end of file -- Gitee From 4fe5a627893123abb336212c1a20f91dc96ed34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E4=BA=A8=E4=BC=9F?= <529310475@qq.com> Date: Thu, 1 Dec 2022 22:02:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=AC=A1=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20221201\345\237\272\347\241\200.md" | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 "11 \351\202\271\344\272\250\344\274\237/20221201\345\237\272\347\241\200.md" diff --git "a/11 \351\202\271\344\272\250\344\274\237/20221201\345\237\272\347\241\200.md" "b/11 \351\202\271\344\272\250\344\274\237/20221201\345\237\272\347\241\200.md" new file mode 100644 index 0000000..c14f39f --- /dev/null +++ "b/11 \351\202\271\344\272\250\344\274\237/20221201\345\237\272\347\241\200.md" @@ -0,0 +1,75 @@ +# 笔记 + +数据类型 + +基本数据类型,引用类型string + +基本:数值,整数(byte short int long) + +小数:float(浮动)单精度 + +double 双精度{默认} + +字符.char + +参与算术运算的时候是以十进制呈现 + +非数值{布尔 true/ false} + +引用 String字符串 + +变量 定义:数据类型,变量的名称:变量的值 + +int age = 18; + +byte short + +​ int long float double + +char + +算数运算符 + - * / % 取余 + +控制流程语句 + +int a = 65 + +string result + +if ( a<60){result=“不及格"} + +if(a==60){result="刚好及格"} + +if。。。。。。 + +if2 + +if (a>91){ + +}else if (a>80) + + + +```java +import java.util.Scanner; + +public class A1 { + public static void main(String[] args) { + Scanner Sc = new Scanner(System.in); + System.out.println("请输入国足的进球数"); + double a = Sc.nextDouble(); + if (a > 7 || a < 0) { + System.out.println("你是申报把"); + }else if (a==1) { + System.out.println("666"); + }else if (a==2) { + System.out.println("吃个人参吧"); + }else if (a==3) { + System.out.println("我裸奔"); + { + } + + } + } +} +``` \ No newline at end of file -- Gitee