質問編集履歴
5
訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,15 +34,15 @@
|
|
34
34
|
|
35
35
|
memset(b, '\0', sizeof(b));
|
36
36
|
|
37
|
-
for(j = 0; j < 4; j++){
|
37
|
+
for(j = 0; j < 4; j++){
|
38
38
|
|
39
|
-
if(i & (1 << j)){
|
39
|
+
if(i & (1 << j)){ // ***
|
40
40
|
|
41
41
|
b[k] = a[j];
|
42
42
|
|
43
43
|
k++;
|
44
44
|
|
45
|
-
}
|
45
|
+
} // ***
|
46
46
|
|
47
47
|
}
|
48
48
|
|
4
訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
int main(void){
|
24
24
|
|
25
|
-
char a[4] = "A
|
25
|
+
char a[4] = "ABCD";
|
26
26
|
|
27
27
|
char b[4];
|
28
28
|
|
3
訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,15 +34,15 @@
|
|
34
34
|
|
35
35
|
memset(b, '\0', sizeof(b));
|
36
36
|
|
37
|
-
for(j = 0; j < 4; j++){
|
37
|
+
for(j = 0; j < 4; j++){
|
38
38
|
|
39
|
-
if(i & (1 << j)){
|
39
|
+
if(i & (1 << j)){ // ***
|
40
40
|
|
41
41
|
b[k] = a[j];
|
42
42
|
|
43
43
|
k++;
|
44
44
|
|
45
|
-
}
|
45
|
+
} // ***
|
46
46
|
|
47
47
|
}
|
48
48
|
|
2
訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
int main(void){
|
24
24
|
|
25
|
-
char a[4] = "AB
|
25
|
+
char a[4] = "AGOB";
|
26
26
|
|
27
27
|
char b[4];
|
28
28
|
|
@@ -36,21 +36,19 @@
|
|
36
36
|
|
37
37
|
for(j = 0; j < 4; j++){
|
38
38
|
|
39
|
-
if(
|
39
|
+
if(i & (1 << j)){
|
40
40
|
|
41
|
-
printf("%d-%d", (i >> j), j);
|
42
|
-
|
43
|
-
b[k] = a[
|
41
|
+
b[k] = a[j];
|
44
42
|
|
45
43
|
k++;
|
46
44
|
|
47
|
-
}
|
45
|
+
}
|
48
46
|
|
49
47
|
}
|
50
48
|
|
51
49
|
for(m = 0; m < 4; m++){
|
52
50
|
|
53
|
-
printf("%c"
|
51
|
+
printf("%c", b[m]);
|
54
52
|
|
55
53
|
}
|
56
54
|
|
1
加筆訂正
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|