回答編集履歴
1
修正
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
void Hanoi(int n,
|
15
|
+
void Hanoi(int n,char* X, char* Y, char* Z) {
|
16
16
|
|
17
17
|
char tmp;
|
18
18
|
|
@@ -24,11 +24,11 @@
|
|
24
24
|
|
25
25
|
/* Xの円盤をZに移動する */
|
26
26
|
|
27
|
-
tmp =
|
27
|
+
tmp = X[strlen(X)-1];
|
28
28
|
|
29
|
-
|
29
|
+
X[strlen(X)-1] = '\0';
|
30
30
|
|
31
|
-
|
31
|
+
Z[strlen(Z)] = tmp;
|
32
32
|
|
33
33
|
printf("//A:%s\n//B:%s\n//C:%s\n//----------\n", disk[0], disk[1], disk[2]);
|
34
34
|
|
@@ -50,7 +50,7 @@
|
|
50
50
|
|
51
51
|
strcpy(disk[2],"");
|
52
52
|
|
53
|
-
Hanoi(3,0,1,2);
|
53
|
+
Hanoi(3,disk[0],disk[1],disk[2]);
|
54
54
|
|
55
55
|
return 0;
|
56
56
|
|