2020-11-03 统计负数零整数个数
缘由双精度数组的输入为什么会出现错误?_编程语言-CSDN问答 https://bbs.bccn.net/redirect.php?tid=503749&goto=lastpost#lastpost
void 回复用统计负数零整数个数()
{//缘由https://ask.csdn.net/questions/1100384int n, i, a = 0, b = 0, c = 0;float num;scanf_s("%d", &n);for (i = 0; i<n; i++){scanf_s("%f", &num);//float 用"%f",double 用"%lf"if (num == 0.0) b++;if (num>0.0) c++;if (num<0.0) a++;}printf_s("%d %d %d", a, b, c);
}