A36905. 给定程序中,函数fun的功能是:不断从终端读入整数,由变量a统计大于0的个数,用变量c来统计小于0的个数,当输入O时结束输入,并通过形参pa和pb把统计的数据传回主函数进行输出。#include <stdio.h>#include <stdlib.h>void fun(int *px,int *py){ /**********found**********/ int __(1)__; scanf…
填空题
困难
知识点
题目描述
给定程序中,函数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");
}
参考答案
<p>1. 正确答案: a=0,c=0,k</p><p>2. 正确答案: (k!=0)</p><p>3. 正确答案: scanf("%d",&k);</p>
上一题
下一题