From ea1f2eada572c90e00a6a219d4b518159fe085a4 Mon Sep 17 00:00:00 2001 From: dengxitong <2452879460@qq.com> Date: Wed, 11 Mar 2026 20:19:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- REDEADME.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 REDEADME.md diff --git a/REDEADME.md b/REDEADME.md new file mode 100644 index 0000000..72bf739 --- /dev/null +++ b/REDEADME.md @@ -0,0 +1,33 @@ +#借用键盘输入工具 +import java.util.Scanner; +#代码放这里 +public class Temperature{ +#从这里开始 + public static void main(String[]args){ +#创建输入工具 + Scanner sc=new Scanner(System.in); +#print这些字 + System.out.println("1.华氏度转摄氏度"); + System.out.println("2.摄氏度转华氏度"); + System.out.println("请选择1/2"); +#新变量 + int choice=sc.nextInt(); +#读取输入之物 + if (choice==1){ + System.out.print("请输入温度:"); +#把输入的温度存到c + double c=sc.nextDouble(); +#把算出来的存到f + double f=c*9/5+32; +#输出 + System.out.printf("%.2f",f); + }else if(choice==2){ + System.out.print("请输入温度:"); + double c=sc.nextDouble(); + double f=(c-32)*5/9; + System.out.printf("%.2f",f); + } +#关闭程序 + sc.close(); + } +} \ No newline at end of file