以下程式執行後會輸出什麼?- void G() {
- char t, item[] = {'5', '3', '8', '6', '2'};
- int a, b, c, count = 5;
- for (a = 0; a < count - 1; a = a + 1) {
- c = a;
- t = item[a];
- for (b = a + 1; b < count; b = b + 1) {
- if (item[b] < t) {
- c = b;
- t = item[b];
- }
- if (a == 1 && b == 3) {
- printf("%c %d\n", t, c);
- }
- }
- }
- }
複製代碼 (A) 3 1
(B) 3 2
(C) 5 1
(D) 6 3
本帖隱藏的內容需要積分高於 1 才可瀏覽 |