-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInfRecul.java
More file actions
64 lines (47 loc) · 894 Bytes
/
InfRecul.java
File metadata and controls
64 lines (47 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
public class InfRecul
{
public static void main(String[] args)
{
showHi(3);
}
public static void showHi(int cnt) // 3
{
// 오류 코드
/*
//System.out.println("Hi~ ");
System.out.printf("Hi~ (%d)\n", cnt);
showHi(cnt--); // showHi(3); showHi(3)....
if (cnt == 1)
{
return;
}
*/
/*
// 정상코드
System.out.printf("Hi~ (%d)\n", cnt);
if (cnt-- == 1)
{
//테스트(확인)
//System.out.println("cnt - 3 : " + (cnt -3));
return;
}
showHi(cnt);
*/
/*
System.out.println("Hi~ ");
//System.out.printf("Hi~ (%d)\n", cnt);
showHi(--cnt); // showHi(2); showHi(1); showHi(0); showHi(-1)....
if (cnt == 1)
{
return;
}
*/
System.out.println("Hi~ ");
//System.out.printf("Hi~ (%d)\n", cnt);
if (cnt == 1)
{
return;
}
showHi(--cnt); // showHi(2); ....
}
}