發表文章

目前顯示的是 4月, 2024的文章

謝孜妤python與javascript程式碼對照

圖片
html程式碼 謝孜妤輸入參數 輸入k 輸入m 輸入n 執行自訂函數 重點 alert內建函數,自訂函數abc 謝孜妤輸出結果 CSS=Cascading Style Sheet 單獨放置檔案abc.css與abc.js也可以放在html檔案內,放置在區塊內 css程式碼 h1{background-color: rgb(245, 7, 245); color: white; border: 10px solid rgb(0, 217, 255); text-align:center; padding: 5px} ul{background-color: green; color: white; font-size: 2em;line-height:1.5} input{font-size:24px;background-color:rgb(210, 250, 215);} .monkey{font-size:36px;} out{background-color:pink;color:blueviolet;}/*css的註解 #k{background-color:white;}/*為id的註解 js程式碼 const space=' ', slash='/', backslash='\\', cr='\n'; function row1(k,m){ for(let i=0; i<k;i++){ for(let ii=0; ii<m; ii++){ for(let j=0; j<k-i-1; j++) out+=space; out+=slash; for(let j=0; j<2*i; j++) out+=space; out+=backslash; for(let j=0; j<k-i-1;j++) out+=space;}; out+=cr