From b505022e262adb25d41a46e93a8bb7e2df6e44f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=8C=97=E5=8D=9A?= <1072852081@qq.com> Date: Mon, 13 Feb 2023 10:43:45 +0800 Subject: [PATCH 1/3] 'yang' --- yang.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 yang.js diff --git a/yang.js b/yang.js new file mode 100644 index 0000000..3882c0b --- /dev/null +++ b/yang.js @@ -0,0 +1 @@ +console.log("杨茗博"); \ No newline at end of file -- Gitee From ffa17f40e58ef7111735d1d0e8d8b9b634d4b27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=8C=97=E5=8D=9A?= <1072852081@qq.com> Date: Tue, 14 Feb 2023 17:27:18 +0800 Subject: [PATCH 2/3] 11 --- yang.js | 1 - ...30\351\231\244\344\275\234\344\270\232.js" | 22 +++++++++++++++++++ .../\346\265\213\350\257\225.js" | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) delete mode 100644 yang.js create mode 100644 "\346\235\250\350\214\227\345\215\232/\345\212\240\345\207\217\344\271\230\351\231\244\344\275\234\344\270\232.js" create mode 100644 "\346\235\250\350\214\227\345\215\232/\346\265\213\350\257\225.js" diff --git a/yang.js b/yang.js deleted file mode 100644 index 3882c0b..0000000 --- a/yang.js +++ /dev/null @@ -1 +0,0 @@ -console.log("杨茗博"); \ No newline at end of file diff --git "a/\346\235\250\350\214\227\345\215\232/\345\212\240\345\207\217\344\271\230\351\231\244\344\275\234\344\270\232.js" "b/\346\235\250\350\214\227\345\215\232/\345\212\240\345\207\217\344\271\230\351\231\244\344\275\234\344\270\232.js" new file mode 100644 index 0000000..dc56361 --- /dev/null +++ "b/\346\235\250\350\214\227\345\215\232/\345\212\240\345\207\217\344\271\230\351\231\244\344\275\234\344\270\232.js" @@ -0,0 +1,22 @@ +let obj={ + 'jia' : function(a,b){ + console.log(a+b); + }, + 'jian': function (a,b){ + console.log(a-b); + }, + 'cheng' : function (a,b){ + console.log(a*b); + }, + 'chu' : function (a,b){ + console.log(a/b); + }, + + 'new':function(a,b){ + this.jia(a,b); + this.jian(a,b); + this.cheng(a,b); + this.chu(a,b); + } + }; + module.exports=obj; \ No newline at end of file diff --git "a/\346\235\250\350\214\227\345\215\232/\346\265\213\350\257\225.js" "b/\346\235\250\350\214\227\345\215\232/\346\265\213\350\257\225.js" new file mode 100644 index 0000000..cdb92fe --- /dev/null +++ "b/\346\235\250\350\214\227\345\215\232/\346\265\213\350\257\225.js" @@ -0,0 +1,2 @@ +let obj=require("./加减乘除作业.js"); +obj.new(1,2); \ No newline at end of file -- Gitee From ba04bd6f604eec32a56991a946a097fdccf19d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=8C=97=E5=8D=9A?= <1072852081@qq.com> Date: Thu, 16 Feb 2023 16:30:27 +0800 Subject: [PATCH 3/3] 11 --- .../yang/11.js" | 15 +++++++++++++++ .../yang/22.js" | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 "\346\235\250\350\214\227\345\215\232/yang/11.js" create mode 100644 "\346\235\250\350\214\227\345\215\232/yang/22.js" diff --git "a/\346\235\250\350\214\227\345\215\232/yang/11.js" "b/\346\235\250\350\214\227\345\215\232/yang/11.js" new file mode 100644 index 0000000..e870958 --- /dev/null +++ "b/\346\235\250\350\214\227\345\215\232/yang/11.js" @@ -0,0 +1,15 @@ +var fs = Require('fs'); +var arr = new Array(); +for(var i = 1 ; i<=1000 ;i++ ){ + arr[i-1]=Math.ceil(Math.random()*1001); + fs.writeFile( + i+'.txt', + ''+arr[i-1], + (err)=>{ + if(err){ + console.log(err); + return false; + } + } + ) +} \ No newline at end of file diff --git "a/\346\235\250\350\214\227\345\215\232/yang/22.js" "b/\346\235\250\350\214\227\345\215\232/yang/22.js" new file mode 100644 index 0000000..14a8340 --- /dev/null +++ "b/\346\235\250\350\214\227\345\215\232/yang/22.js" @@ -0,0 +1,19 @@ +var fs = Require('fs'); + +var arr = new Array(); + + +for(var i= 1; i<=100;i++){ + var data= fs.readfilesync(i+'.txt'); + arr[i-1] = data.tostring(); + console.log("同步读取 :" + i +"个" + arr[i-1]); + +} + +var max = 0; +for(var j = 0 ; j