在下面程序运行后,输出结果为 ______。 #include<iostream.h> void count(int x[],int n,int &y){ int k; y=0; for(k=0:k<n;k++)

admin2009-01-15  36

问题 在下面程序运行后,输出结果为 ______。    #include<iostream.h>    void count(int x[],int n,int &y){      int k;      y=0;      for(k=0:k<n;k++)          if(x[k]<0) y++;    }    void main(){       int b[]={2,1,-8,-3,7,2,4,6,0,-13};       int x;       count(b,10,x);       cout<<“x”<<x<<end1;    }

选项 A、x=3
B、x=5
C、出错
D、x=0

答案1

解析
转载请注明原文地址:https://kaotiyun.com/show/6ikp777K
0

最新回复(0)