---
# System prepended metadata

title: 0homework02最後一題，如果有更好想法可以分享，覺得弄得有點長

---

# 0homework02最後一題，如果有更好想法可以分享，覺得弄得有點長

public class homework2_3 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		//輸出如題所示之資料圖形
		int m;
		int n;
		
		for(m=1;m<=6;m++) {
			for(n=1;n<=m;n++) {
				switch(m) {
				case 1:
				    System.out.print("A");
				    break;				
				case 2:
					System.out.print("B");
					break;	
				case 3:
					System.out.print("C");
					break;	
				case 4:
					System.out.print("D");
					break;	
				case 5:
					System.out.print("E");
					break;	
				case 6:
					System.out.print("F");
					break;					
				}
				
			}
			System.out.println();
			
		}

	}

}
