期中考網頁檔案對照Python寫入

CSS示範程式碼

h1{background-color: purple; color: white; border: 10px solid red; 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;}

HTML示範程式碼

<link rel='stylesheet' href="abc.css"> <script src="abs.js"></script> <h1>劉任昌輸入參數</h1> 輸入k<input type="number" value="1" id="k"></input><br> 輸入m<input type="number" value="1" id="m"></input><br> 輸入n<input type="number" value="1" id="n"></input><br> <button onclick="abc()">執行自訂函數</button> <h1>重點</h1> alert內建函數,自訂函數abc <h1>劉任昌輸出結果</h1> <div id="out" class="monkey"></div>

JAVASCRIPT示範程式碼

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;};};
function row2(k,m){
for(let i=0; i<k; i++){
for(let ii=0; ii<m; ii++){
for(let j=0; j<i; j++)
out+=space;
out+=backslash;
for(let j=0; j<2*k-2*i-2; j++)
out+=space;
out+=slash;
for(let j=0; j<i;j++)
out+=space;};
out+=cr;};};
function abc(){
k = document.getElementById('k').value;
m = document.getElementById('m').value;
n = document.getElementById('n').value;
out ='<pre>\n';
for(let i=0; i<n; i++){
row1(k,m);
row2(k,m);}
out += '</pre>';
document.getElementById('out').innerHTML=out;}

留言

  1. https://ctz642895.blogspot.com/2024/04/python.html

    回覆刪除
  2. https://keiime.blogspot.com/2024/04/python.html

    回覆刪除
  3. https://kk0725.blogspot.com/2024/04/python.html

    回覆刪除
  4. https://oscarliu1688.blogspot.com/2024/04/blog-post.html

    回覆刪除
  5. https://tustning.blogspot.com/2024/04/h1background-color-pink-colorwhite.html

    回覆刪除
  6. https://www.blogger.com/blog/post/edit/2910868344786410340/9212831085422515935

    回覆刪除
  7. https://htmlcssjavascriptjavapython.blogspot.com/2024/04/python.html

    回覆刪除
  8. https://aks8704100.blogspot.com/2024/04/python.html

    回覆刪除
  9. https://hui026.blogspot.com/2024/04/htmlcssjavascriptjavapython-python-4-08.html

    回覆刪除
  10. https://yun0205.blogspot.com/2024/04/python.html

    回覆刪除
  11. https://xi715.blogspot.com/2024/04/blog-post.html

    回覆刪除
  12. https://imyuannn.blogspot.com/2024/04/pythonvsjavascriptdocument.html

    回覆刪除
  13. https://kungyuting.blogspot.com/2024/04/pythonvsjavascriptdocument.html

    回覆刪除
  14. https://wang-yu-jia-wangyujia.blogspot.com/2024/04/blog-post.html

    回覆刪除
  15. https://liu-guang-wei.blogspot.com/2024/04/python.html

    回覆刪除
  16. https://kitty030994.blogspot.com/2024/04/pythonjavascript.html

    回覆刪除
  17. https://shenzhenxuan.blogspot.com/2024/04/pythonjavascript.html

    回覆刪除
  18. https://stanley-ouo.blogspot.com/2024/04/python-javascript.html

    回覆刪除
  19. https://chen0119.blogspot.com/2024/04/240412n11214147.html

    回覆刪除
  20. https://chienyinghuan.blogspot.com/2024/04/pythonjavascript.html

    回覆刪除
  21. https://willie-lai611.blogspot.com/2024/04/pythonjavascript.html

    回覆刪除
  22. https://www.blogger.com/blog/post/edit/4616311045112546689/5720363743089349468

    回覆刪除
  23. https://guan-yu-zhu.blogspot.com/2024/04/pythonjavascript.html

    回覆刪除
  24. https://russellma2005525.blogspot.com/2024/04/pythonjavascript.html

    回覆刪除
  25. 作者已經移除這則留言。

    回覆刪除
  26. 作者已經移除這則留言。

    回覆刪除
  27. https://ryanareryan.blogspot.com/2024/04/blog-post.html

    回覆刪除
  28. https://leeyicheng0531.blogspot.com/2024/04/python.html

    回覆刪除
  29. https://wilson11122.blogspot.com/2024/04/blog-post.html

    回覆刪除
  30. https://www.blogger.com/blog/post/edit/preview/246862186134119617/2522052631152165508

    回覆刪除
  31. https://addison030.blogspot.com/2024/04/python.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

柯聞折Javascript物件導向方法是物件的函數

甲劉任昌python串列List(陣列Array),元組Tuple,集合Set,字典Dict

劉任昌PYTHON陣列ARRAY串列LIST字典DIC集合SET元組TUPLE