437 changed files with 0 additions and 21654 deletions
@ -1,10 +0,0 @@ |
|||
# 默认忽略的文件 |
|||
/shelf/ |
|||
/workspace.xml |
|||
# 已忽略包含查询文件的默认文件夹 |
|||
/queries/ |
|||
# Datasource local storage ignored files |
|||
/dataSources/ |
|||
/dataSources.local.xml |
|||
# 基于编辑器的 HTTP 客户端请求 |
|||
/httpRequests/ |
|||
@ -1,10 +0,0 @@ |
|||
<component name="libraryTable"> |
|||
<library name="lib"> |
|||
<CLASSES> |
|||
<root url="jar://$PROJECT_DIR$/jdk-21.0.10/lib/jrt-fs.jar!/" /> |
|||
<root url="jar://$PROJECT_DIR$/jdk-21.0.10/lib/src.zip!/" /> |
|||
</CLASSES> |
|||
<JAVADOC /> |
|||
<SOURCES /> |
|||
</library> |
|||
</component> |
|||
@ -1,6 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="ProjectRootManager" version="2" languageLevel="JDK_24" default="true" project-jdk-name="temurin-24" project-jdk-type="JavaSDK"> |
|||
<output url="file://$PROJECT_DIR$/out" /> |
|||
</component> |
|||
</project> |
|||
@ -1,8 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="ProjectModuleManager"> |
|||
<modules> |
|||
<module fileurl="file://$PROJECT_DIR$/Desktop.iml" filepath="$PROJECT_DIR$/Desktop.iml" /> |
|||
</modules> |
|||
</component> |
|||
</project> |
|||
@ -1,6 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="VcsDirectoryMappings"> |
|||
<mapping directory="" vcs="Git" /> |
|||
</component> |
|||
</project> |
|||
@ -1,16 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<module type="JAVA_MODULE" version="4"> |
|||
<component name="NewModuleRootManager" inherit-compiler-output="true"> |
|||
<exclude-output /> |
|||
<content url="file://$MODULE_DIR$"> |
|||
<sourceFolder url="file://$MODULE_DIR$/W1-何欣蓉-202506050223" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/w1" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/w2" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/w4" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/w5" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/w7" isTestSource="false" /> |
|||
</content> |
|||
<orderEntry type="inheritedJdk" /> |
|||
<orderEntry type="sourceFolder" forTests="false" /> |
|||
</component> |
|||
</module> |
|||
@ -1 +0,0 @@ |
|||
AI为我协助完成了Python到Java的代码转换,解释了Java中Scanner类的使用方法。当编译出现"找不到符号"错误时,AI指导添加了import语句解决了问题。AI还提供了命令行参数解析和批量文件处理的实现方案,并帮助编写了README文档和运行说明。 |
|||
@ -1,8 +0,0 @@ |
|||
# 温度转换器 (TemperatureConverter) |
|||
|
|||
这是一个Java版本的温度转换程序,支持摄氏度(°C)与华氏度(°F)之间的相互转换。 |
|||
|
|||
## 编译方法 |
|||
|
|||
```bash |
|||
javac TemperatureConverter.java |
|||
@ -1,159 +0,0 @@ |
|||
/** |
|||
* 温度转换器程序(Java版) |
|||
* 支持摄氏度(C)与华氏度(F)之间互转 |
|||
*/ |
|||
import java.util.Scanner; |
|||
import java.io.BufferedReader; |
|||
import java.io.FileReader; |
|||
import java.io.IOException; |
|||
import java.io.FileNotFoundException; |
|||
|
|||
public class TemperatureConverter { |
|||
|
|||
/** |
|||
* 将摄氏度转换为华氏度 |
|||
* |
|||
* @param c 摄氏温度 |
|||
* @return 对应的华氏温度 |
|||
*/ |
|||
public static double celsiusToFahrenheit(double c) { |
|||
return c * 9.0 / 5.0 + 32.0; |
|||
} |
|||
|
|||
/** |
|||
* 将华氏度转换为摄氏度 |
|||
* |
|||
* @param f 华氏温度 |
|||
* @return 对应的摄氏温度 |
|||
*/ |
|||
public static double fahrenheitToCelsius(double f) { |
|||
return (f - 32.0) * 5.0 / 9.0; |
|||
} |
|||
|
|||
/** |
|||
* 交互模式:从控制台读取输入并转换 |
|||
*/ |
|||
public static void interactiveMode() { |
|||
Scanner scanner = new Scanner(System.in); |
|||
|
|||
// 提示用户输入,格式示例:"36.6 C" 或 "97 F"
|
|||
System.out.print("请输入要转换的温度与单位(例如 36.6 C 或 97 F):"); |
|||
String input = scanner.nextLine().trim(); |
|||
|
|||
if (input.isEmpty()) { |
|||
System.out.println("输入为空,程序退出。"); |
|||
scanner.close(); |
|||
return; |
|||
} |
|||
|
|||
processInput(input); |
|||
scanner.close(); |
|||
} |
|||
|
|||
/** |
|||
* 处理输入的字符串并输出转换结果 |
|||
* |
|||
* @param input 输入的字符串 |
|||
*/ |
|||
public static void processInput(String input) { |
|||
String[] parts = input.split("\\s+"); |
|||
|
|||
try { |
|||
// 解析数值和单位
|
|||
double value = Double.parseDouble(parts[0]); |
|||
String unit = (parts.length > 1) ? parts[1].toUpperCase() : "C"; |
|||
|
|||
if (unit.startsWith("C")) { |
|||
// 从摄氏度转换为华氏度
|
|||
double f = celsiusToFahrenheit(value); |
|||
System.out.printf("%.1f °C = %.2f °F%n", value, f); |
|||
} else if (unit.startsWith("F")) { |
|||
// 从华氏度转换为摄氏度
|
|||
double c = fahrenheitToCelsius(value); |
|||
System.out.printf("%.1f °F = %.2f °C%n", value, c); |
|||
} else { |
|||
System.out.println("未知单位,请使用 C 或 F。"); |
|||
} |
|||
} catch (NumberFormatException e) { |
|||
System.out.println("输入解析失败,请按示例输入数值与单位,例如:36.6 C"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 命令行参数模式 |
|||
* |
|||
* @param args 命令行参数 |
|||
*/ |
|||
public static void commandLineMode(String[] args) { |
|||
if (args.length < 1) { |
|||
System.out.println("请提供温度数值和单位,例如:36.6 C"); |
|||
return; |
|||
} |
|||
|
|||
try { |
|||
double value = Double.parseDouble(args[0]); |
|||
String unit = (args.length > 1) ? args[1].toUpperCase() : "C"; |
|||
|
|||
if (unit.startsWith("C")) { |
|||
double f = celsiusToFahrenheit(value); |
|||
System.out.printf("%.1f °C = %.2f °F%n", value, f); |
|||
} else if (unit.startsWith("F")) { |
|||
double c = fahrenheitToCelsius(value); |
|||
System.out.printf("%.1f °F = %.2f °C%n", value, c); |
|||
} else { |
|||
System.out.println("未知单位,请使用 C 或 F。"); |
|||
} |
|||
} catch (NumberFormatException e) { |
|||
System.out.println("参数解析失败,请提供有效的数值。"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 批量文件处理模式 |
|||
* |
|||
* @param filename 输入文件名 |
|||
*/ |
|||
public static void batchMode(String filename) { |
|||
try { |
|||
BufferedReader reader = new BufferedReader(new FileReader(filename)); |
|||
String line; |
|||
int lineNumber = 0; |
|||
|
|||
System.out.println("批量转换结果:"); |
|||
System.out.println("================"); |
|||
|
|||
while ((line = reader.readLine()) != null) { |
|||
lineNumber++; |
|||
line = line.trim(); |
|||
if (line.isEmpty() || line.startsWith("#")) { |
|||
continue; // 跳过空行和注释行
|
|||
} |
|||
|
|||
System.out.print("第" + lineNumber + "行: "); |
|||
processInput(line); |
|||
} |
|||
|
|||
reader.close(); |
|||
} catch (FileNotFoundException e) { |
|||
System.out.println("文件未找到: " + filename); |
|||
} catch (IOException e) { |
|||
System.out.println("读取文件时出错: " + e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
public static void main(String[] args) { |
|||
if (args.length > 0) { |
|||
// 命令行参数模式
|
|||
if (args[0].equals("-batch") && args.length > 1) { |
|||
// 批量文件处理模式
|
|||
batchMode(args[1]); |
|||
} else { |
|||
// 普通命令行参数模式
|
|||
commandLineMode(args); |
|||
} |
|||
} else { |
|||
// 交互模式
|
|||
interactiveMode(); |
|||
} |
|||
} |
|||
} |
|||
|
Before Width: | Height: | Size: 45 KiB |
@ -1,118 +0,0 @@ |
|||
Your use of this Program is governed by the No-Fee Terms and Conditions set |
|||
forth below, unless you have received this Program (alone or as part of another |
|||
Oracle product) under an Oracle license agreement (including but not limited to |
|||
the Oracle Master Agreement), in which case your use of this Program is governed |
|||
solely by such license agreement with Oracle. |
|||
|
|||
Oracle No-Fee Terms and Conditions (NFTC) |
|||
|
|||
Definitions |
|||
|
|||
"Oracle" refers to Oracle America, Inc. "You" and "Your" refers to (a) a company |
|||
or organization (each an "Entity") accessing the Programs, if use of the |
|||
Programs will be on behalf of such Entity; or (b) an individual accessing the |
|||
Programs, if use of the Programs will not be on behalf of an Entity. |
|||
"Program(s)" refers to Oracle software provided by Oracle pursuant to the |
|||
following terms and any updates, error corrections, and/or Program Documentation |
|||
provided by Oracle. "Program Documentation" refers to Program user manuals and |
|||
Program installation manuals, if any. If available, Program Documentation may be |
|||
delivered with the Programs and/or may be accessed from |
|||
www.oracle.com/documentation. "Separate Terms" refers to separate license terms |
|||
that are specified in the Program Documentation, readmes or notice files and |
|||
that apply to Separately Licensed Technology. "Separately Licensed Technology" |
|||
refers to Oracle or third party technology that is licensed under Separate Terms |
|||
and not under the terms of this license. |
|||
|
|||
Separately Licensed Technology |
|||
|
|||
Oracle may provide certain notices to You in Program Documentation, readmes or |
|||
notice files in connection with Oracle or third party technology provided as or |
|||
with the Programs. If specified in the Program Documentation, readmes or notice |
|||
files, such technology will be licensed to You under Separate Terms. Your rights |
|||
to use Separately Licensed Technology under Separate Terms are not restricted in |
|||
any way by the terms herein. For clarity, notwithstanding the existence of a |
|||
notice, third party technology that is not Separately Licensed Technology shall |
|||
be deemed part of the Programs licensed to You under the terms of this license. |
|||
|
|||
Source Code for Open Source Software |
|||
|
|||
For software that You receive from Oracle in binary form that is licensed under |
|||
an open source license that gives You the right to receive the source code for |
|||
that binary, You can obtain a copy of the applicable source code from |
|||
https://oss.oracle.com/sources/ or http://www.oracle.com/goto/opensourcecode. If |
|||
the source code for such software was not provided to You with the binary, You |
|||
can also receive a copy of the source code on physical media by submitting a |
|||
written request pursuant to the instructions in the "Written Offer for Source |
|||
Code" section of the latter website. |
|||
|
|||
------------------------------------------------------------------------------- |
|||
|
|||
The following license terms apply to those Programs that are not provided to You |
|||
under Separate Terms. |
|||
|
|||
License Rights and Restrictions |
|||
|
|||
Oracle grants to You, as a recipient of this Program, subject to the conditions |
|||
stated herein, a nonexclusive, nontransferable, limited license to: |
|||
|
|||
(a) internally use the unmodified Programs for the purposes of developing, |
|||
testing, prototyping and demonstrating your applications, and running the |
|||
Program for Your own personal use or internal business operations; and |
|||
|
|||
(b) redistribute the unmodified Program and Program Documentation, under the |
|||
terms of this License, provided that You do not charge Your licensees any fees |
|||
associated with such distribution or use of the Program, including, without |
|||
limitation, fees for products that include or are bundled with a copy of the |
|||
Program or for services that involve the use of the distributed Program. |
|||
|
|||
You may make copies of the Programs to the extent reasonably necessary for |
|||
exercising the license rights granted herein and for backup purposes. You are |
|||
granted the right to use the Programs to provide third party training in the use |
|||
of the Programs and associated Separately Licensed Technology only if there is |
|||
express authorization of such use by Oracle on the Program's download page or in |
|||
the Program Documentation. |
|||
|
|||
Your license is contingent on compliance with the following conditions: |
|||
|
|||
- You do not remove markings or notices of either Oracle's or a licensor's |
|||
proprietary rights from the Programs or Program Documentation; |
|||
|
|||
- You comply with all U.S. and applicable export control and economic sanctions |
|||
laws and regulations that govern Your use of the Programs (including technical |
|||
data); |
|||
|
|||
- You do not cause or permit reverse engineering, disassembly or decompilation |
|||
of the Programs (except as allowed by law) by You nor allow an associated |
|||
party to do so. |
|||
|
|||
For clarity, any source code that may be included in the distribution with the |
|||
Programs is provided solely for reference purposes and may not be modified, |
|||
unless such source code is under Separate Terms permitting modification. |
|||
|
|||
Ownership |
|||
|
|||
Oracle or its licensors retain all ownership and intellectual property rights to |
|||
the Programs. |
|||
|
|||
Information Collection |
|||
|
|||
The Programs' installation and/or auto-update processes, if any, may transmit a |
|||
limited amount of data to Oracle or its service provider about those processes |
|||
to help Oracle understand and optimize them. Oracle does not associate the data |
|||
with personally identifiable information. Refer to Oracle's Privacy Policy at |
|||
www.oracle.com/privacy. |
|||
|
|||
Disclaimer of Warranties; Limitation of Liability |
|||
|
|||
THE PROGRAMS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ORACLE FURTHER |
|||
DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION, ANY |
|||
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR |
|||
NONINFRINGEMENT. |
|||
|
|||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL ORACLE BE LIABLE TO YOU FOR |
|||
DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES |
|||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT |
|||
LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY |
|||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER |
|||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE |
|||
POSSIBILITY OF SUCH DAMAGES. |
|||
@ -1,6 +0,0 @@ |
|||
Thank you for using the Oracle JDK. |
|||
The license for this software can be found in the LICENSE file. |
|||
|
|||
Information on installing, configuring, and running this program is available on https://java.com/readme |
|||
|
|||
Documentation on the Java SE Platform can be found on https://docs.oracle.com/java |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue