From 209ecdd952cf587e85bc91f1ff8528cd17aa663e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9E=97=E7=8F=8A?= <13159217895>
Date: Tue, 14 Feb 2023 10:45:11 +0800
Subject: [PATCH 1/2] =?UTF-8?q?'=E6=9E=97=E7=8F=8A'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../2\346\234\21014.html" | 12 ------------
"\346\236\227\347\217\212/\346\236\227.txt" | 1 +
2 files changed, 1 insertion(+), 12 deletions(-)
delete mode 100644 "\345\221\250\345\277\227\346\235\260/2\346\234\21014.html"
create mode 100644 "\346\236\227\347\217\212/\346\236\227.txt"
diff --git "a/\345\221\250\345\277\227\346\235\260/2\346\234\21014.html" "b/\345\221\250\345\277\227\346\235\260/2\346\234\21014.html"
deleted file mode 100644
index 5b741126..00000000
--- "a/\345\221\250\345\277\227\346\235\260/2\346\234\21014.html"
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
- 纪2023年2月14日
-
-
- 城南小陌又逢春,只见桃花不见人. 人有生老三千疾,唯有相思不可医.
-
-
\ No newline at end of file
diff --git "a/\346\236\227\347\217\212/\346\236\227.txt" "b/\346\236\227\347\217\212/\346\236\227.txt"
new file mode 100644
index 00000000..6ac94a2f
--- /dev/null
+++ "b/\346\236\227\347\217\212/\346\236\227.txt"
@@ -0,0 +1 @@
+沈梦瑶
\ No newline at end of file
--
Gitee
From 09d6bed02acad95fa877bc1985e807587b06ef8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9E=97=E7=8F=8A?= <13159217895>
Date: Wed, 15 Feb 2023 16:59:24 +0800
Subject: [PATCH 2/2] =?UTF-8?q?'=E4=BD=9C=E4=B8=9A'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../calculate.js" | 5 +++
.../calculator.js" | 33 +++++++++++++++++++
"\346\236\227\347\217\212/\346\236\227.txt" | 1 -
3 files changed, 38 insertions(+), 1 deletion(-)
create mode 100644 "\346\236\227\347\217\212/\345\212\240\345\207\217\344\271\230\351\231\244/calculate.js"
create mode 100644 "\346\236\227\347\217\212/\345\212\240\345\207\217\344\271\230\351\231\244/calculator.js"
delete mode 100644 "\346\236\227\347\217\212/\346\236\227.txt"
diff --git "a/\346\236\227\347\217\212/\345\212\240\345\207\217\344\271\230\351\231\244/calculate.js" "b/\346\236\227\347\217\212/\345\212\240\345\207\217\344\271\230\351\231\244/calculate.js"
new file mode 100644
index 00000000..a3a89e15
--- /dev/null
+++ "b/\346\236\227\347\217\212/\345\212\240\345\207\217\344\271\230\351\231\244/calculate.js"
@@ -0,0 +1,5 @@
+let calculate = require("./calculator");
+console.log(calculate.jia(1,2));
+console.log(calculate.jian(11,1));
+console.log(calculate.cheng(1,2));
+console.log(calculate.chu(20,2));
\ No newline at end of file
diff --git "a/\346\236\227\347\217\212/\345\212\240\345\207\217\344\271\230\351\231\244/calculator.js" "b/\346\236\227\347\217\212/\345\212\240\345\207\217\344\271\230\351\231\244/calculator.js"
new file mode 100644
index 00000000..30d32ef3
--- /dev/null
+++ "b/\346\236\227\347\217\212/\345\212\240\345\207\217\344\271\230\351\231\244/calculator.js"
@@ -0,0 +1,33 @@
+var result = /^[0-9]+[0-9]*/;
+let obj = {
+ jia: function(a, b) {
+ if(!result.test(a) || !result.test(b)) {
+ return "输入的数为非数值类型,请重新输入";
+ }else{
+ return a + b;
+ }
+ },
+ jian: function(a, b) {
+ if(!result.test(a) || !result.test(b)) {
+ return "输入的数为非数值类型,请重新输入";
+ }else{
+ return a - b;
+ }
+ },
+ cheng: function(a, b) {
+ if(!result.test(a) || !result.test(b)) {
+ return "输入的数为非数值类型,请重新输入";
+ }else{
+ return a * b;
+ }
+ },
+ chu: function(a, b) {
+ var res = /^[1-9]+[0-9]*/;
+ if(!res.test(a) || !res.test(b)) {
+ return "其中一个为0或非数值类型,请重新输入";
+ }else{
+ return a / b;
+ }
+ }
+}
+module.exports = obj;
\ No newline at end of file
diff --git "a/\346\236\227\347\217\212/\346\236\227.txt" "b/\346\236\227\347\217\212/\346\236\227.txt"
deleted file mode 100644
index 6ac94a2f..00000000
--- "a/\346\236\227\347\217\212/\346\236\227.txt"
+++ /dev/null
@@ -1 +0,0 @@
-沈梦瑶
\ No newline at end of file
--
Gitee