填空题 以下程序运行时输出到屏幕的结果中第一行是 1,第二行是 2
#include<iostream.h>
int fun(int x)
{
static int y=1,z=0;
y*=x;
z+=y;
return z;
}
void main()
{
int x;
for(x=1;x<3;x++)
cout<<fun(x)<<endl:
}
【正确答案】
【答案解析】1、3