填空题

给定程序中,函数fun的功能是:不断从终端读入整数,由变量a统计大于0的个数,用变量c来统计小于0的个数,当输入O时结束输入,并通过形参pa和pb把统计的数据传回主函数进行输出。

#include <stdio.h>

#include <stdlib.h>

void fun(int *px,int *py)

{

    /**********found**********/

    int __(1)__;

    scanf("%d",&k);

    /**********found**********/

    while __(2)__

    {

        if(k>0)

        {

            a++;

        }

        if(k<0)

        {

            c++;

        }

        /**********found**********/

        __(3)__;

    }

    *px=a;

    *py=c;

}

main()

{

    int x, y;

    fun(&x,&y);

    printf("x=%d y=%d\n", x, y);

    system("pause");

}

赣ICP备20007335号-2