首页 > 试题广场 >

以下 C 代码的运行结果是什么() #include st

[单选题]
以下 C 代码的运行结果是什么()
#include <stdio.h>

int main() {
    int numbers[5];
    int* p;
    p = numbers;  *p = 10;
    p++;  *p = 20;
    p = &numbers[2];  *p = 30;
    p = numbers + 3;  *p = 40;
    p = numbers;  *(p + 4) = 50;
    for (int n = 0; n < 5; n++)
        printf("%d", numbers[n]);
        printf(" ");
    return 0;
} 
  • 10 20 30 40 50
  • 1020304050
  • 编译错误
  • 运行错误
我以为你考的是这个 结果你考过是这个
发表于 2025-05-15 00:47:35 回复(0)
哈哈,不加括号执行一行啊,涨知识了
发表于 2025-05-07 15:11:58 回复(0)