- 1、本文档共19页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
C_primr_plus部分作业答案-自己做的
1#includestdio.hint main(void){int a, b,c,d,f,e;c = A;d = 1;for (a = 0; a = 8; a += 2){d++;printf(%*c,7-d,32);for (b = 1; b = d - 1; b++){printf(%c,c + b - 1);}if (b != 2){e= c + b - 3;for (f = 1; f = d - 2;f++)printf(%c, e-f+1);}printf(\n);}}2#includestdio.h#includemath.hint main(void){double num1, num2;printf(请输入两个数,空格间隔:);scanf_s(%lf,%lf,num1,num2);for (num1; num1 = num2;num1++)printf(%.1lf %5.1lf %5.1lf\n,num1,pow(num1,2),pow(num1,3));}34#includestdio.h#includectype.hint main(void){float float1, float2;int num1;printf(请输入两个浮点数:);num1=scanf_s(%f,%f,float1,float2);while (num1==2){printf(%f, (float1 - float2) / float1*float2);scanf_s(%f,%f, float1, float2);}printf(请输入正确的数!);}5#includestdio.h#includemath.hint main(void){int num1, num2, num3,num4;printf(请顺序输入两个数);scanf_s(%d,%d,num1,num2);while (num1 num2){num3 = 0;for (num1; num1 = num2; num1++){num4 = num1;num4 *= num4;num3 +=num4;}printf(%d\n,num3);scanf_s(%d,%d, num1, num2);}}6int num3,num4;num2 = 0, num5 = 0,num6=0;scanf_s(%d,num3);for (num4 = 1; num4 = num3; num4++){num6 += 1.0 / num4; //正确}for (num1 = 1; num1 = (int)(num3 / 2); num1++){num2 += 1.0 / (2.0 *(float) num1 - 1); //奇数项有误未解决奇数项问题,除2后截取为偶数项已修正num5 +=1.0/ (2.0 * (float)num1); //偶数项有误已修正}if (num3 % 2 != 0)num2 += 1.0 / num3;printf(%f,%f,num6,num2-num5);}7#includestdio.hint main(void){double num1, num2;num1 = 1000000.0;num2 =0;while (num1= 0){num2++;num1= (num1 - 10000.0)*0.08+(num1-100000.0);}printf(%f, num2);return 0;}8#includestdio.h#includectype.hint main(void){int a;int b, c, n, n1;b=c=n1=n=0.0;scanf_s(%d, a);while (a!=0){if (a % 2 == 0){b += a;n++;}else{c += a;n1++;}scanf_s(%d,a);}printf(偶数和%d,平均%.1f,个数%d;奇数和%d,平均%.1f,个数%d,b,((float)b)/n,n,c,((float)c)/n1,n1);}9#includestdio.hint main(void){char alp;int n;n = 0;while ((alp = getchar()) != #){n++;if (alp == ?){printf(!);}elseif (alp == !){printf(!!);}elseprintf(%c, alp);}printf(\n%d,n);return 0;}10#includestdio.hint main(vo
文档评论(0)