问题详情

答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关

有以下程序#include<stdio.h> void fun(int *s) { static int j=0; do { s[j]=s[j]+s[j+1]


有以下程序

#include<stdio.h>

void fun(int *s)

{ static int j=0;

do { s[j]=s[j]+s[j+1]; )while(j<2);

}

main()

{ int k,a[10]={1,2,3,4,5);

for(k=1;k<3;k++)fun(a);

for(k=0;k<5;k++)printf(”%d”,a[k]);

printf(" ");

}

程序运行后的输出结果是

A) 12345

B)23445

C)34756

D) 35745

参考答案
您可能感兴趣的试题