Created
December 8, 2015 10:26
-
-
Save mindwing/ebce20b5e6078df8d57f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fast Campus 안드로이드 앱 개발 입문 캠프 | |
* Java for Android (by mindwing) | |
* [3일차] 강의노트 - 배열, 메서드 정의와 호출방법, I/O | |
* 도전과제3 - 커맨드 라인 인자길이의 밑변을 가지는 직각삼각형 모양 출력 | |
*/ | |
public class D3_Challenge_3_1 { | |
public static void main(String[] args) { | |
if (args.length == 0) { | |
System.out.println("직각삼각형 밑변의 길이를 정해주세요."); | |
return; | |
} | |
int limit = Integer.parseInt(args[0]); | |
for (int i = 0; i < limit; i = i + 1) { | |
for (int line = 0; line <= i; line = line + 1) { | |
System.out.print("*"); | |
} | |
System.out.println(""); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment