commit 297cc6869f697f44b7f907610b216a5e28128725
Author: 陈思豪 <1437200870@qq.com>
Date: Wed Aug 7 09:29:23 2024 +0800
日考18
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5ff6309
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..aa00ffa
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..82dbec8
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..05ea65d
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,17 @@
+
+
+ 4.0.0
+
+ com.bwie
+ day-18
+ 1.0-SNAPSHOT
+
+
+ 17
+ 17
+ UTF-8
+
+
+
diff --git a/src/main/java/com/bwie/Main.java b/src/main/java/com/bwie/Main.java
new file mode 100644
index 0000000..b027987
--- /dev/null
+++ b/src/main/java/com/bwie/Main.java
@@ -0,0 +1,32 @@
+package com.bwie;
+
+import java.math.BigDecimal;
+
+public class Main {
+ public static void main(String[] args) {
+ double num1= 17.43;
+ double num2= 71.31;
+ BigDecimal bigDecimal1 = BigDecimal.valueOf(num1);
+ BigDecimal bigDecimal2 = BigDecimal.valueOf(num2);
+
+
+
+// 1.使用BigDecimal进行加法计算,并打印在控制台上。(20分)
+ BigDecimal sum = BigDecimal.valueOf(Double.sum(num1 ,num2));
+ System.out.println(sum);
+
+// 2.使用BigDecimal进行减法计算,并打印在控制台上。(20分)
+ BigDecimal jian = BigDecimal.valueOf(num1- num2);
+ System.out.println(jian);
+
+// 3.使用BigDecimal进行乘法计算,并打印在控制台上。(20分)
+ BigDecimal ch = BigDecimal.valueOf(num1*num2);
+ System.out.println(ch);
+
+// 4.使用BigDecimal进行除法计算,并打印在控制台上。(20分)
+ BigDecimal chu = BigDecimal.valueOf(num1/num2);
+ System.out.println(chu);
+
+ }
+
+}