Java,整數int,字串String,迴圈for loop
/*劉任昌2022/10/21學習迴圈for loop利用挪威w3schools*/
public class Main { /*類別名稱Main存檔的檔名必須Main.java*/
public static void main(String[] args) {
int i, j, k=12; /*宣告整數integer, i*/
String a="第", b="列: "; /*宣告整數字串 */
for (i = k; i > 0; i--) {
System.out.print( a + i + b); /*+用於字串變數,串接,相當於excel的*/
for (j=1; j<=i; j++)
System.out.print(j+" "); /*語法syntax錯誤,邏輯logic錯誤*/
System.out.println(); /*println=print line印完到下一列*/
}
}
}
w3schools學習Java截圖
Character.toString將字碼轉字元
/*劉任昌2022/10/21學習迴圈for loop利用挪威w3schools*/
public class Main { /*類別名稱Main存檔的檔名必須Main.java*/
public static void main(String[] args) {
int i, j, k=12; /*宣告整數integer, i*/
String a="第", b="列: "; /*宣告整數字串 */
for (i = k; i > 0; i--) {
System.out.print( a + i + b);/*+用於字串變數,串接,相當於excel的&*/
for (j=1; j<=i; j++)
System.out.print(j+" "); /*語法syntax錯誤,邏輯logic錯誤*/
System.out.println(); /*println=print line印完到下一列*/
} /*捲括號curly bracket{ }*/
a = " 字碼是字元 ";
System.out.println(48 + a + Character.toString(48));
System.out.println(65 + a + Character.toString(65));
System.out.println(97 + a + Character.toString(97));
System.out.println(122 + a + Character.toString(122));
System.out.println("傳統ascii只到127,字碼系統再擴展到所有文字unicode系統");
for ( i = 40845; i < 40860; i++){
b = Character.toString(i);
System.out.println(i + a + b);
}
}
}
Character.toString將字碼轉字元
字元轉字碼Integer.valueOf
https://xdrcfvghyujiok8945656.blogspot.com/2022/10/w3schoolsjavaintstringfor-loopcharactor.html
回覆刪除https://rtytrdtfg.blogspot.com/2022/10/w3schoolsjavaintstringfor.html
回覆刪除https://tgyhjikolujik2554.blogspot.com/2022/10/w3schoolsjavaintstringfor.html
回覆刪除https://d11150114.blogspot.com/2022/10/w3schoolsjavaintstringfor.html
回覆刪除https://d11150115.blogspot.com/2022/10/w3schoolsjavaintstringfor.html
回覆刪除https://d11150108.blogspot.com/2022/10/wschoojavaintstring-for.html
回覆刪除https://d11150116.blogspot.com/2022/10/w3schooljavaintstringfor.html
回覆刪除https://d11150113.blogspot.com/2022/10/20221021for-loopw3schools.html
回覆刪除https://643gjeytfru4312.blogspot.com/2022/10/w3schoolsjavaintstringfor.html
回覆刪除https://cindy-javascript.blogspot.com/2022/10/w3schooljavaintstringfor.html
回覆刪除https://jdoifjopq1264.blogspot.com/2022/10/w3schooljavaintstringfor.html
回覆刪除https://iuytjhg5261.blogspot.com/2022/10/w3schoolsjavaintstringfor.html
回覆刪除作者已經移除這則留言。
回覆刪除https://d11150112.blogspot.com/2022/10/w3schooljavaintstringfor.html
回覆刪除https://lihtml-css-javascript-java.blogspot.com/2022/10/0-i-system.html
回覆刪除