From 784c0b9dc18941cd4b4e2587d54a5535fbba5007 Mon Sep 17 00:00:00 2001 From: Harshreich <773407390@qq.com> Date: Thu, 13 Oct 2022 19:45:28 +0800 Subject: [PATCH 1/9] . --- .../\344\275\234\344\270\232/22.10.13.js" | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 "10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.13.js" diff --git "a/10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.13.js" "b/10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.13.js" new file mode 100644 index 0000000..405532e --- /dev/null +++ "b/10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.13.js" @@ -0,0 +1,41 @@ +var start =0; +var sum =0; +while (start<=100) { + start+=1; + if (start%2==0) { + sum+=start; + } + if (sum>=1000) { + break; + } +} +console.log(start); + +while (start<=100) { + start+=1; + if (start%2==0&&start%7==0) { + sum+=start; + } +} +console.log(sum); + +var year =199; +while (year<=2022) { + year+=1; + if (year%4==0&&year%100!=0) { + console.log(year); + } +} + +var i = prompt('请输入成绩') +if (i>=90&&i<=100) { + alert('A') +}else if (i>=80&&i<90) { + alert('B') +}else if (i>=60&&i<80) { + alert('C') +}else if (i>=0&&i<=60) { + alert('D') +}else{ + alert('不合法') +} \ No newline at end of file -- Gitee From 59da5c8c8e746db2296cce55b9ddf2bd49b890d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=8A=E7=AB=A5?= <10033735+Harshreich@user.noreply.gitee.com> Date: Fri, 14 Oct 2022 05:53:43 +0000 Subject: [PATCH 2/9] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\254\224\350\256\260/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" diff --git "a/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" "b/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 1f28d1942c313df013208bfaa6af4fc993e8fdc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=8A=E7=AB=A5?= <10033735+Harshreich@user.noreply.gitee.com> Date: Fri, 14 Oct 2022 05:53:50 +0000 Subject: [PATCH 3/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2010?= =?UTF-8?q?=E9=99=88=E6=98=8A=E7=AB=A5/=E7=AC=94=E8=AE=B0/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\254\224\350\256\260/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 "10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" diff --git "a/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" "b/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" deleted file mode 100644 index e69de29..0000000 -- Gitee From f1f0e6f0824d8125face529a1694d8cb5b38a198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=8A=E7=AB=A5?= <10033735+Harshreich@user.noreply.gitee.com> Date: Fri, 14 Oct 2022 05:54:01 +0000 Subject: [PATCH 4/9] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\254\224\350\256\260/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" diff --git "a/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" "b/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 2ad1d0f22fc340349c04c421359ef27c68d345d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=8A=E7=AB=A5?= <10033735+Harshreich@user.noreply.gitee.com> Date: Fri, 14 Oct 2022 05:54:16 +0000 Subject: [PATCH 5/9] =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈昊童 <10033735+Harshreich@user.noreply.gitee.com> --- .../\347\254\224\350\256\260/22.10.13.js.md" | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 "10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/22.10.13.js.md" diff --git "a/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/22.10.13.js.md" "b/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/22.10.13.js.md" new file mode 100644 index 0000000..ef2a7b6 --- /dev/null +++ "b/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/22.10.13.js.md" @@ -0,0 +1,49 @@ +在html中嵌套javascript + + + + + +var let (声明函数) + +打印在网页 : document.write(); 在网页上打印括号中的值 + +弹窗:alert() 弹窗显示括号中的值 + +弹窗输入 :var name = prompt('请输入一个名字') + +console.log() ---打印出值 + +if 判断: + +if(条件){ + +}else if(条件){ + +}else{ + +} + +for 循环: + + for (let i = 1; i <= 100; i++) { + + } + + + +switch 判断: + +switch (条件) { + + case 值: + + alert('优秀') + + break; + + default: + + break; + + } \ No newline at end of file -- Gitee From 20e49c504d99bb68d56a91beb8daef4764ad3182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=8A=E7=AB=A5?= <10033735+Harshreich@user.noreply.gitee.com> Date: Fri, 14 Oct 2022 05:54:23 +0000 Subject: [PATCH 6/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2010?= =?UTF-8?q?=E9=99=88=E6=98=8A=E7=AB=A5/=E7=AC=94=E8=AE=B0/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\254\224\350\256\260/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 "10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" diff --git "a/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" "b/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/.keep" deleted file mode 100644 index e69de29..0000000 -- Gitee From d85181ef9a8231f0e0a33b4d502793bb61987e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=8A=E7=AB=A5?= <10033735+Harshreich@user.noreply.gitee.com> Date: Fri, 14 Oct 2022 09:38:53 +0000 Subject: [PATCH 7/9] =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈昊童 <10033735+Harshreich@user.noreply.gitee.com> --- .../\344\275\234\344\270\232/22.10.14.js" | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 "10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.14.js" diff --git "a/10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.14.js" "b/10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.14.js" new file mode 100644 index 0000000..8a73d8c --- /dev/null +++ "b/10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.14.js" @@ -0,0 +1,47 @@ +// 1.将A5F3转成2进制 + var c ='A5F3'; + var d = parseInt(c,16) + d.toString(2) + console.log(d); +// 2.99乘法表 + var a=1; + + while (a<10) { + var b=1; + while (b<=a) { + document.write(b,'*',a,'=',a*b,' ') + b++; + } + document.write('
') + a++; + } +// 3.输入年月,(用数组) + var date =prompt('输入日期,用.分割') ; + const arr = date.split('.'); + var year= arr[0]; + var month= arr[1]; + var day= arr[2]; +// 3.1.计算当月有多少天 + if (month==2) { + if (year%4==0&&year%100!=0) { + console.log(month,'月有',29,'天'); + }else{ + console.log(month,'月有',28,'天'); + } + }else if (month==1||month==3||month==5||month==7||month==8||month==10||month==12) { + console.log(month,'月有',31,'天'); + }else if (month==4||month==6||month==9||month==11) { + console.log(month,'月有',30,'天'); + } +// 3.2.计算还剩多少天 + if (month==2) { + if (year%4==0&&year%100!=0) { + console.log(month,'月还有',29-day,'天'); + }else{ + console.log(month,'月还有',28-day,'天'); + } + }else if (month==1||month==3||month==5||month==7||month==8||month==10||month==12) { + console.log(month,'月还有',31-day,'天'); + }else if (month==4||month==6||month==9||month==11) { + console.log(month,'月还有',30-day,'天'); + } -- Gitee From be1787d942cd750c341e45cc4748753045a51b56 Mon Sep 17 00:00:00 2001 From: Harshreich <773407390@qq.com> Date: Sat, 15 Oct 2022 23:24:57 +0800 Subject: [PATCH 8/9] . --- .../\344\275\234\344\270\232/22.10.14.js" | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git "a/10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.14.js" "b/10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.14.js" index 8a73d8c..685f758 100644 --- "a/10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.14.js" +++ "b/10\351\231\210\346\230\212\347\253\245/\344\275\234\344\270\232/22.10.14.js" @@ -1,8 +1,7 @@ // 1.将A5F3转成2进制 var c ='A5F3'; var d = parseInt(c,16) - d.toString(2) - console.log(d); + console.log(d.toString(2)); // 2.99乘法表 var a=1; -- Gitee From 14b549a0d7c7ec0dbcd430c8f5848982e82e7d2c Mon Sep 17 00:00:00 2001 From: Harshreich <773407390@qq.com> Date: Sun, 16 Oct 2022 20:59:15 +0800 Subject: [PATCH 9/9] . --- .../22.10.14js\345\237\272\347\241\200.md" | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 "10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/22.10.14js\345\237\272\347\241\200.md" diff --git "a/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/22.10.14js\345\237\272\347\241\200.md" "b/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/22.10.14js\345\237\272\347\241\200.md" new file mode 100644 index 0000000..0a99544 --- /dev/null +++ "b/10\351\231\210\346\230\212\347\253\245/\347\254\224\350\256\260/22.10.14js\345\237\272\347\241\200.md" @@ -0,0 +1,22 @@ +1.Switch +2.基本数据类型: number , boolean, string, null , undefined + var a = '5'+1 // + 其中有一个是字符串, 默认是字符串的连接 + var a = '5' // + var b = a*2 // + - * 、 %隐式类型转化 + var b = -a + console.log('类型:' + typeof b + '值:' + b);//查看数据是什么类型 +3.显示数据类型 +NaN : 非数 number +Number():转换成数字,失败会变成 NaN +false:0 true:1 null:0 undefined:NaN + +parseInt(a,radix): 将(radix)进制 转成 10进制 +//var a = 'F' //-->0 1 2 3 4 5 6 7 8 9 A B C D E F +//var b = parseInt(a,16) + +String():转成字符串 +toFixed(n):保留小数点后n位 +a.toString(radix):将十进制数的a转换成radix进制的数 +isNaN(): 是不是非数,是数字的话--》false 不是数字--》true +Math: 舍入 ceil(向上取整) floor(向下取整) round(四舍五入) +\ No newline at end of file \ No newline at end of file -- Gitee