// 三:程序阅读题 // 1. 求和 function mainprogramToRead1(){ let i,j,sum; for(i=2;i<7;i++){ sum = 1; for ( j=1;j<7;j++ ) sum = sum + j; } console.log(sum); } mainprogramToRead1() // 2.找出数组中最大值 function mainprogramToRead2(){ let x=[122,33,55,678,-987]; let max = x[0]; for (let i=1;i<x.length;i++){ if (x[i]>max){ max=x[i]; } } console.log(max); } mainprogramToRead2() // 编写程序题 //writeProgram