D1111111劉任昌JavaScript將輸入的字串顛倒輸出
網頁介面
劉任昌輸入字串:
程式碼
<p>劉任昌輸入字串:<input type="text" len="40" id="in"></p><p><input type="button" value="執行JavaScript" onclick="f()"></p><p id="out"></p><script>function f(){var a = document.getElementById("in").value;/*取得id=in的文字*/var b = "原字串: " + a + "<br>長度是:" + a.length + ",反串是: ";var c = "";for (var i = 0; i < a.length; i++)c = a.slice(i,i+1) + c ;b = b + "<font size=7>" + c + "</font>";document.getElementById("out").innerHTML = b;}</script>
Java程式設計
import java.util.Scanner; /*開啟套件package util=utility用途,Scanner掃描器*/ /*白皓與utility industry=公用事業產業,電力,自來水,效用=utility */ class MyClass { public static void main(String[] args) { String a, b=""; /*定義字串a,b */ Scanner myObj = new Scanner(System.in); /*建構掃描物件*/ System.out.print("輸入: "); a = myObj.nextLine(); /*輸入文字nextLine到變數a */ System.out.println("長度: " + a.length());/*輸出字串長度length() */ for (int i = 0; i < a.length(); i++) /*迴圈 */ b = a.charAt(i) + b; /*a字元順序放到b前面*/ System.out.println("輸出: "+ b); } }
https://kuanhtml-css-javascript-java.blogspot.com/2023/01/d11117216.html
回覆刪除https://gary123123123.blogspot.com/2023/01/d11117220javascript.html
回覆刪除https://xylia-lin.blogspot.com/2023/01/d11117222javascript.html
回覆刪除https://sandy-html-css-javascript.blogspot.com/2023/01/d11117302javascript.html
回覆刪除https://ling-cls.blogspot.com/2023/01/d11117309javascript.html
回覆刪除https://eric-young92.blogspot.com/2023/01/d11117319javascript.html
回覆刪除https://sallyjhang.blogspot.com/2023/01/d11117301javascript.html
回覆刪除https://shanan-00.blogspot.com/2023/01/h1background-color-yellow-function-f.html
回覆刪除https://michael-hou.blogspot.com/2023/01/d11117318javascript.html
回覆刪除https://zhangzheming920304.blogspot.com/2023/01/d11117314javascript.html
回覆刪除https://html-css-javascript-java.blogspot.com/2023/01/d1111111javascript.html
回覆刪除https://tinggggggggggg.blogspot.com/2023/01/d11117213javascript.html
回覆刪除https://hsuppppp.blogspot.com/2023/01/d11117224javascript.html
回覆刪除https://tonyzhuang1.blogspot.com/2023/01/d11117223javascript.html
回覆刪除https://chen-yu-hsi.blogspot.com/2023/01/javascannerlengthcharat.html
回覆刪除https://chenyuhung123.blogspot.com/2023/01/javascript.html
回覆刪除https://liaoyongruei.blogspot.com/2023/01/d11117330.html
回覆刪除https://guixiu1485.blogspot.com/2023/01/d11117324javascript.html
回覆刪除https://html-css-javascript-javadd.blogspot.com/2023/01/javascript.html
回覆刪除https://www.blogger.com/blog/post/edit/3109934186771125311/5410273518164713743
回覆刪除https://www.blogger.com/blog/post/edit/preview/5683775077331287445/5333550568247893564
回覆刪除https://www.blogger.com/blog/post/edit/8098460896125661899/4167256795233737060
回覆刪除https://connie921213.blogspot.com/2023/01/d11117212-javascript.html
回覆刪除https://purplefish-ouo.blogspot.com/2023/01/d11117214-javascript.html
回覆刪除https://meishiuanlin.blogspot.com/2023/01/d11117322javascript.html
回覆刪除https://html-css-javascript-html.blogspot.com/2023/01/d11117217javascript.html
回覆刪除https://d11117312.blogspot.com/2023/01/d11117312javascript.html
回覆刪除https://erichtml-css-javascript-java.blogspot.com/2023/01/javascript.html
回覆刪除https://steven0918.blogspot.com/2023/01/d11117219javascript.html
回覆刪除https://html-css-javascript-javatang.blogspot.com/2023/01/d11117310javascript.html
回覆刪除https://www.blogger.com/blog/post/edit/preview/8772960102027701639/4122596144829088309
回覆刪除https://d11117328.blogspot.com/2023/01/d11117328javascript.html
回覆刪除https://howardpai.blogspot.com/2023/01/d11117203javascript.html
回覆刪除https://1dth36.blogspot.com/2023/01/d11117316javascript.html
回覆刪除https://d11117331.blogspot.com/2023/01/d11117331javascript.html
回覆刪除https://pandora-mo.blogspot.com/2023/01/javascript.html
回覆刪除方思涵
https://1dth36.blogspot.com/2023/01/d11117316javascript_8.html
回覆刪除https://d11117328.blogspot.com/2023/01/d11117328javascript_18.html
回覆刪除