- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
函数练习参考代码(国外英文资料)
函数练习参考代码(国外英文资料)
Test nine function
I. implementation of basic capabilities:
1) the design function min (x, y) returns the smaller value in the two double values.
#include stdio.h
Double min (double, a, double, B);
Int main (void)
{
Double, x, y;
Printf (Enter two numbers:);
Scanf (%lf%lf, x, y);
Printf (The, smaller, number,%f.\n, is, min (x, y));
Return 0;
}
Double min (double, a, double, b)
{
Return a B? A: b;
}
2) write a program, tune function to achieve the function: (1) for the sum of two numbers; (2) find the difference between the two numbers; (3) find the product of the two numbers.
#include stdio.h
Double add (double, a, double, b)
{
Return a+b;
}
Double subtract (double, a, double, b)
{
Return a-b;
}
Double multiple (double, a, double, b)
{
Return a*b;
}
Int, main ()
{
Double, num1, num2;
Printf (please input tow number:);
Scanf (%lf%lf, num1, num2);
Printf (%5.2f +%5.2f =%5.2f\n, num1, num2, add (num1, num2));
Printf (%5.2f +%5.2f =%5.2f\n, num1, num2, subtract (num1, num2));
Printf (%5.2f +%5.2f =%5.2f\n, num1, num2, multiple (num1, num2));
}
3) write a function, the function of the 3 parameters is a character and two integers. The character parameter is the character that needs to be output. The first integer shows the number of characters output in each row, while the second integer refers to the number of lines to be output, and a program that calls the function is written.
#include stdio.h
Void chLineRow (char, CH, int, C, int, R);
Int main (void)
{
Char ch;
Int, col, row;
Printf (Enter a character (to quit #):);
While ((CH) = (getchar) =#!)
{
If (CH =\n)
Continue;
Printf (Enter, number, of, columns, and, number, of, rows:);
If (scanf (%d,%d), col, row) = = 2)
Break;
ChLineRow (CH, col, row);
Printf (\nEnter next character (to quit #):);
}
Printf (Bye, \n);
Return 0;
}
Void chLineRow (char, CH, int, C, int, R)
{
Int, col, row;
For (row = 0; row R; row++)
{
For (Col = 0; col C; col++)
{
Putchar (CH);
}
Putchar (\n);
}
}
4) the function of the fol
您可能关注的文档
- 【分享】Cocos2d-x字符串整顿及字符串转换方法总结(国外英文资料).doc
- 【推荐】08年四级英语快速浏览(国外英文资料).doc
- 《高级措辞法度模范设计》第17章在线测试(国外英文资料).doc
- 【好梦网】浅谈路易斯安那州立大学(国外英文资料).doc
- 【推荐】英语四级浏览高分快速浏览四大轨则(国外英文资料).doc
- 【文明概论】墨家人本主义思惟和西方人性主义思惟的比拟(国外英文资料).doc
- 【主、谓、宾、定、状、补】你弄明白了么?(国外英文资料).doc
- 【智汇通】灵巧性计谋的制胜之道(国外英文资料).doc
- 【优化计划】2014纲目版第一部分第一节专题七 非谓语动词(国外英文资料).doc
- 【清华】课程整理(国外英文资料).doc
- 2025四川南充市公路管理局南充市水务局遴选3人笔试备考题库附答案解析.docx
- 2025年清水河县事业单位联考招聘考试历年真题完美版.docx
- 2025年正安县事业单位联考招聘考试历年真题完美版.docx
- 2025年金沙县事业单位联考招聘考试真题汇编新版.docx
- 2025年乐业县辅警招聘考试真题汇编及答案1套.docx
- 2025年新龙县事业单位联考招聘考试历年真题附答案.docx
- 2025年淮阳县事业单位联考招聘考试历年真题含答案.docx
- 2025年紫金县事业单位联考招聘考试真题汇编含答案.docx
- 2025年永福县事业单位联考招聘考试历年真题推荐.docx
- 2025年睢县事业单位联考招聘考试历年真题含答案.docx
原创力文档


文档评论(0)