From 3203cc29d57db8c17535c80e87e95a2a68ee1615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9D=99?= <2500150461@qq.com> Date: Mon, 13 Feb 2023 16:38:13 +0800 Subject: [PATCH 1/6] hj --- "\351\273\204\351\235\231/\351\273\204\351\235\231.txt" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\351\273\204\351\235\231/\351\273\204\351\235\231.txt" diff --git "a/\351\273\204\351\235\231/\351\273\204\351\235\231.txt" "b/\351\273\204\351\235\231/\351\273\204\351\235\231.txt" new file mode 100644 index 0000000..e69de29 -- Gitee From 362e71482d6fb7c9977fa5d98a4438a0c3a2ce53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9D=99?= <2500150461@qq.com> Date: Thu, 16 Feb 2023 09:17:27 +0000 Subject: [PATCH 2/6] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\351\273\204\351\235\231/\346\250\241\345\235\227/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\351\273\204\351\235\231/\346\250\241\345\235\227/.keep" diff --git "a/\351\273\204\351\235\231/\346\250\241\345\235\227/.keep" "b/\351\273\204\351\235\231/\346\250\241\345\235\227/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From c918a7315522ce0a9219ba1a7aff9ca8299e6e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9D=99?= <2500150461@qq.com> Date: Thu, 16 Feb 2023 09:18:04 +0000 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\346\226\207\344\273\266\350\257\273\345\217\226/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\351\273\204\351\235\231/\346\226\207\344\273\266\350\257\273\345\217\226/.keep" diff --git "a/\351\273\204\351\235\231/\346\226\207\344\273\266\350\257\273\345\217\226/.keep" "b/\351\273\204\351\235\231/\346\226\207\344\273\266\350\257\273\345\217\226/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From f5e23ec5651e1099f18862c13732286d2c93b11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9D=99?= <2500150461@qq.com> Date: Thu, 16 Feb 2023 09:19:16 +0000 Subject: [PATCH 4/6] =?UTF-8?q?=E9=BB=84=E9=9D=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄静 <2500150461@qq.com> --- .../\346\250\241\345\235\227/moban.js" | 31 +++++++++++++++++++ .../\346\250\241\345\235\227/text.js" | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 "\351\273\204\351\235\231/\346\250\241\345\235\227/moban.js" create mode 100644 "\351\273\204\351\235\231/\346\250\241\345\235\227/text.js" diff --git "a/\351\273\204\351\235\231/\346\250\241\345\235\227/moban.js" "b/\351\273\204\351\235\231/\346\250\241\345\235\227/moban.js" new file mode 100644 index 0000000..1c4cf0e --- /dev/null +++ "b/\351\273\204\351\235\231/\346\250\241\345\235\227/moban.js" @@ -0,0 +1,31 @@ +let obj={ + add:function(num1,num2){ + return num1+num2; + }, + sub:function(num1,num2){ + return num1-num2; + }, + mul:function(num1,num2){ + return num1*num2; + }, + div:function(num1,num2){ + return num1/num2; + }, + suan:function(num1,num2,symbal){ + if(!Number(num1)){ + console.log("num1必须要为数字"); + return false; + } + if(!Number(num2)&&(num2)!=0){ + console.log("num2必须要为数字"); + return false; + } + if(symbal=="div"){ + if(!Number(num2)==0){ + console.log("被除数不能为零") + } + } + return this [symbal] (num1,num2); + } +}; +module.exports=obj; \ No newline at end of file diff --git "a/\351\273\204\351\235\231/\346\250\241\345\235\227/text.js" "b/\351\273\204\351\235\231/\346\250\241\345\235\227/text.js" new file mode 100644 index 0000000..21c638c --- /dev/null +++ "b/\351\273\204\351\235\231/\346\250\241\345\235\227/text.js" @@ -0,0 +1,2 @@ +let sul=require("./moban.js"); +console.log(sul.suan(2,3,"add")); \ No newline at end of file -- Gitee From 60b6f7e2ccd0a77c8cd73279632ca7d380e87fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9D=99?= <2500150461@qq.com> Date: Thu, 23 Feb 2023 09:25:36 +0000 Subject: [PATCH 5/6] =?UTF-8?q?=E9=BB=84=E9=9D=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄静 <2500150461@qq.com> --- .../homework3.js" | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 "\351\273\204\351\235\231/0220 \346\226\207\344\273\266\346\265\201/homework3.js" diff --git "a/\351\273\204\351\235\231/0220 \346\226\207\344\273\266\346\265\201/homework3.js" "b/\351\273\204\351\235\231/0220 \346\226\207\344\273\266\346\265\201/homework3.js" new file mode 100644 index 0000000..ee0cf8a --- /dev/null +++ "b/\351\273\204\351\235\231/0220 \346\226\207\344\273\266\346\265\201/homework3.js" @@ -0,0 +1,46 @@ +// +let fs = require("fs"); +function big() { + let str = "asdfghjklqwr"; + let fd = fs.openSync("./txet.txt", "w");//创建一个文本 + for (let i = 0; i < 1000; i++) { + let starat = Math.floor(Math.random() * (str.length));//截取的第一个下标数字 + let end = Math.floor(Math.random() * (str.length));//截取的最后一个下标数字 + if (starat > end) { + //排序 从小到大 例如7 5 + let tem = starat; + starat = end; + end = tem; + }; + if (starat == end) continue; + //用temer 等于 把str的字符串分割 开头数字到结尾数字 + let temer = str.slice(starat, end); + //再fd文本里填写内容 + fs.writeSync(fd, temer); + } + //关闭文本 + fs.closeSync(fd); +} +big(); + +// 用read接收 创建读取文本 +let read = fs.createReadStream("./txet.txt"); +let array = []; +//on 后面的date代表读取数据 text自己设置代表文本 +read.on("data", (text) => { + // 把文本转为字符串 + let str = text.toString(); + for (let i = 0; i < str.length; i++) { + //如果截取到的内容没出现过就存起来 出现过就再加一次 + if(array[str[i]]==undefined){ + array[str[i]]=1; + }else{ + array[str[i]]+=1; + } + + } +}); + +read.on("end",()=>{ + console.log(array); +}) -- Gitee From 4803105a81e29fd861d023e7e639b67ed2c41b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=9D=99?= <2500150461@qq.com> Date: Thu, 23 Feb 2023 09:26:32 +0000 Subject: [PATCH 6/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E9=BB=84=E9=9D=99/=E6=96=87=E4=BB=B6=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\346\226\207\344\273\266\350\257\273\345\217\226/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 "\351\273\204\351\235\231/\346\226\207\344\273\266\350\257\273\345\217\226/.keep" diff --git "a/\351\273\204\351\235\231/\346\226\207\344\273\266\350\257\273\345\217\226/.keep" "b/\351\273\204\351\235\231/\346\226\207\344\273\266\350\257\273\345\217\226/.keep" deleted file mode 100644 index e69de29..0000000 -- Gitee