Link Exchange
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
จากโจทย์ในเว็บ http://www.sourcecode.in.th/homeworks.php?id=1 ความคิดเห็น #11เป็นการเขียนโปรแกรม เพื่อแสดงผลออกมาให้ตรงกับที่โจทย์กำหนด*********************หลักการคือใช้ for-loop ซ้อนกัน 2 ชั้น ชั้นแรกทำ 1-6 เป็นจำนวนของบรรทัดส่วนชั้นด้านใน จะเป็นการแสดงผล * ตามจำนวนที่นับจากชั้นแรกและมีการขึ้นบรรทัดใหม่
package pyramid101; /** * @Auther: Mr.Suppakit Thongdee * @Website: www.sourcecode.in.th */ public class Pyramid101 { /** * @param args the command line arguments */ public static void main(String[] args) { for(int i=1; i<=6; i++){ for(int j=1; j<=i; j++){ System.out.print("*"); } System.out.println(); } } }
Home - Article - Tutorial - Sourcecode - Dev Handbook - Search - WebBoard - Links - About Us