✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
執行下列 C/C++ 程式片段的結果為何?
int a[5], i; a[1] = 0; for (i = 2; i < 5; i++) if (i % 2 == 1) a[i] = a[i-1] + 1; else a[i] = a[i-1] + 2; cout << a[4];