A-A+

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

2020-10-12 15:22:22 IT认证 阅读

问题详情

有以下程序

#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

参考答案

考点: