资源描述:
《c语言:实验三 循环结构》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、0052-数值统计时间限制:1000毫秒内存限制:32768K字节总提次数:2789次成功提交次数:1392次判题规则:严格比较问题描述统计给定的n个数中,负数、零和正数的个数。输入输入数据有多组,每组占一行,每行的第一个数是整数n(n<100),表示需要统计的数值的个数,然后是n个实数;如果n=0,则表示输入结束,该行不做处理。输出对于每组输入数据,输出一行a,b和c,分别表示给定的数据中负数、零和正数的个数。输入样列60123-10512340.50输出样例123005officiallyestablishedonJuly1,2013,Yibincity,formerlyknownasth
2、ebus,integratedoriginalrongzhoubuscompanyinYibincityandMetrobuscompany,formedonlyinYibincityofaState-ownedpublictransportenterprises,thecompanyconsistsofoneortwo,thirdDivision.Integrationofpublictransportservicesisnotyetestablished出处ymcofficiallyestablishedonJuly1,2013,Yibincity,formerlyknownasthebu
3、s,integratedoriginalrongzhoubuscompanyinYibincityandMetrobuscompany,formedonlyinYibincityofaState-ownedpublictransportenterprises,thecompanyconsistsofoneortwo,thirdDivision.Integrationofpublictransportservicesisnotyetestablished01.#include02.intmain()03.{04. inta,b,c,n,i;05. floatx;06
4、. 07. while(1)08. {09. scanf("%d",&n);10. if(n==0)11. break;12. else13. a=b=c=0;14. for(i=1;i<=n;i++)15. {16. scanf("%f",&x);17. if(x<0)18. a++;19. elseif(x==0)20. b++;21. elseif(x>0)22.
5、 c++;23. }24. printf("%d%d%d",a,b,c);25. }26. return0;27. 28.}officiallyestablishedonJuly1,2013,Yibincity,formerlyknownasthebus,integratedoriginalrongzhoubuscompanyinYibincityandMetrobuscompany,formedonlyinYibincityofaState-ownedpublictransportenterprises,thecompanyconsis
6、tsofoneortwo,thirdDivision.Integrationofpublictransportservicesisnotyetestablished0147-阶乘输出时间限制:1000毫秒内存限制:32768K字节总提次数:2214次成功提交次数:1594次判题规则:严格比较问题描述请输出如下所示的阶乘公式3!+4!+5!+6!+7!这个公式表示从3到7的阶乘之和。现在给定两个整数a和b(07、样列37输出样例3!+4!+5!+6!+7!出处officiallyestablishedonJuly1,2013,Yibincity,formerlyknownasthebus,integratedoriginalrongzhoubuscompanyinYibincityandMetrobuscompany,formedonlyinYibincityofaState-ownedpublictra