MakingStar(1)
1.Question
1) Enter a Number N
2) You should make a tier star top
3) First layer line has a star, Second has two.....and Last layer has N star
4) Layer size must be N
2. Solution
import
java.util.Scanner;
public
class
MakingStar_1 {
public
static
void
main(String[]args){
Scanner n =
new
Scanner(System.in);
int
a = n.nextInt();
for
(
int
i =
0
; i<a; i++){
for
(
int
k =
0
; k<i+
1
; k++){
System.out.print(
"*"
);
}
System.out.println();
}
}
}
'Algorithm&DataStructures > StepByStep' 카테고리의 다른 글
[Algorithm] 백준알고리즘_2007 (0) | 2016.08.24 |
---|---|
[Algorithm] 백준알고리즘_MakingStar(2) (0) | 2016.08.24 |
[Algorithm] Multiplication table (0) | 2016.08.24 |
[Algorithm] 백준알고리즘_CountBackwardsN (0) | 2016.08.23 |
[Algorithm] 백준알고리즘_N (0) | 2016.08.23 |