CountBackwardsN
1. Question
1) You have a number N
2) Print out numbers backwards from N to 1
2. Solution
1234567891011121314151617import
java.util.Scanner;
public
class
CountBackward {
public
static
void
main(String[]args){
Scanner c =
new
Scanner(System.in);
int
a = c.nextInt();
for
(
int
i = a; i>
0
; i-- ){
System.out.println(i);
}
}
}
'Algorithm&DataStructures > StepByStep' 카테고리의 다른 글
[Algorithm] 백준알고리즘_MakingStar(1) (0) | 2016.08.24 |
---|---|
[Algorithm] Multiplication table (0) | 2016.08.24 |
[Algorithm] 백준알고리즘_N (0) | 2016.08.23 |
[Algorithm] 백준알고리즘_REST(%) (0) | 2016.08.23 |
[Algorithm] 백준알고리즘_A/B (0) | 2016.08.18 |