:从键盘输入10个整数,分别统计其中的正数,负数,零的个数.
可不可以是简单点的循环语句阿
人气:498 ℃ 时间:2019-08-22 10:26:22
解答
int sum_p = 0, sum_n = 0;
for(int i = 0; i < 10; ++i)
{
int a;
cin>>a;
if(a < 0) sum_n++;
else if(a > 0) sum_p++;
}
cout
推荐
- 编一个程序,输入10个整数,统计并输出其中正数、负数和零的个数.要求用C语言编程.
- 从键盘输入一组非0整数,以输入0标志结束,求这组整数的平均值,并统计其中正数和负数的个数.
- 输入10个整数,统计并输出其中正数、负数和零的个数.
- 输入10个整数, 统计其中的正数、负数和0的个数.
- 编一个程序,输入10个整数,统计并输 出其中正数、负数和零的个数.
- 帮忙配个情侣的签名:When I am out ,take me as the wind.字数意思都相对的,
- 请帮翻译成中文 nine six nine zero eight eight nine six two
- I first poured some oil into the pot,waited for a moment and then put the vegetables into it.翻译
猜你喜欢