#12418. 珅泽教育CSP-J第一轮模拟考第二十八套 第 8 题

珅泽教育CSP-J第一轮模拟考第二十八套 第 8 题

下面程序的输出是( )。

#include <bits/stdc++.h>
using namespace std;
int main() {
    int a[] = {100, 200, 300, 400, 500};
    int *p = a;
    int pos = -1;
    while (p <= &a[3]) {
        printf("%d ", a[++pos]);
        p += 2;
    }
    return 0;
}

{{ select(1) }}

  • 100 300
  • 100 200
  • 100 200 300 400
  • 300 400