下面程序运行后输出结果的第3行为________。#includeint main(){ int i, j, a[8]={1};printf("%3d\n", a[0]);for(i=1; i<8; i++){a[i]=1;for(j=i-1; j>0; j--)a[j]=a[j]+a[j-1];for(j=0; j<=i; j++)printf("%3d", a[j]);printf("\n");}return 0;}
A. 1
B. 1 2 1
C. 1 3 1
D. 1 1
下面程序运行时,输出的结果是________。#includeint main(){ int i,k,a[10]={1,2,3,4,5,6,7,8,9,10},b[3]={0};for(i=0;i<10; i++){k=a[i]%3; b[k]+=a[i];}printf("%d,%d,%d",b[0],b[1],b[2]);return 0;}
A. 18 22 15
B. 18 22 16
C. 17 21 15
D. 17 21 16