- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
c语言函数复习题答案(C language function answers to review questions)
c语言函数复习题答案(C language function answers to review questions)
C language function answers to review questions
1, / * program for AB (B power A). Requirements: seeking to achieve the function of AB function to achieve the output data, A, B input and result in the main function. Where B is a positive integer, A is any real number. * /
#include stdio.h
Void (main)
{long cm (int x, int y);
Int A; int B; int i=1; long s=1;
Printf (enter the base and power);
Scanf (%d%d, A, B);
If (i=B)
S=cm (A, B);
Printf (s=%d\n, s);
}
Long cm (int x, int y)
{long s=1;
Int i;
For (i=1; i=y; i++) s=s*x;
Return s;
}
4, / * write function, the two string (do not use the strcat library function).
#include stdio.h
#include stdio.h
Void (main)
{char a[20], b[20];
Void cat (char a[], char b[]);
Gets (a); gets (B);
Cat (a, B);
Puts (a);
}
Void cat (char a[], char b[])
{int AA, BB, I, j;
Aa=strlen (a), bb=strlen (B);
For (i=aa, j=0; jbb; i++, j++)
A[i]=b[j];
A[i]=\0;
}
6, continue to write a function that will be the number three in order from small to large and output. Enter the number three in the main function, call the function to complete the three number of sorting. * /
#include stdio.h
Void (main)
{int a, B, c;
Void paixu (int a, int b, int c);
Printf (input three numbers:);
Scanf (%d%d%d, a, b, c);
Paixu (a, B, C);
}
Void paixu (int a, int b, int c)
{int flag;
If (ab)
{flag=a;
A=b;
B=flag;
}
If (ac)
{flag=a;
A=c;
C=flag;
}
If (bc)
{flag=b;
B=c;
C=flag;
}
Printf (%d,%d,%d, a, B, C);
}
7, continue to write a function, the function is to determine the prime number is an integer, enter an integer in the main function, call the function,
To determine whether the number is not prime, if the output yes, otherwise output no.
#include stdio.h
(main)
{int sushu (int a);
Int a;
Printf (enter an integer:);
Scanf (%d, a);
If (sushu (a)) printf (prime);
Else printf (prime);
}
Int sushu (int a)
{int i; int j=1;
For (i=2; i=a-1; i++)
If (a%i==0) j=0;
Return j;
}
8, continue to write a function to determin
您可能关注的文档
- ajax技术原理解析(Analysis of Ajax technology principle).doc
- ajax分页功能的无框架实现方法(Frameless implementation method of Ajax paging function).doc
- ajax的http请求发送函数和处理返回信息函数及实例(The Ajax HTTP requests the sending function and processes the returned information function and instances).doc
- ami bios 设置全程图解(AMI BIOS settings throughout the diagram).doc
- adobe premiere pro 四种滚动字幕(adobe premiere pro 四种滚动字幕).doc
- android 4.0操作系统21项新特性图解(The 21 new features of the Android 4 operating system are illustrated).doc
- amx集中控制系统(Amx centralized control system).doc
- android 系统(Android系统).doc
- android 开发环境比较(Android开发环境比较).doc
- android_百度百科(android_百度百科).doc
- c语言在线测试题目及答案(C language online test questions and answers).doc
- c语言参考手册14(C language reference manual 14).doc
- c语言基础五简单循环与时间1(菜鸟编程教学5)(C language five simple cycle time and 1 (Rookie programming teaching 5)).doc
- c语言基本知识(Basic knowledge of C language).doc
- c语言基本语法知识(The basic syntax of C language knowledge).doc
- c语言基础知识总结(The basic knowledge of C language summary).doc
- c语言复习题库(C language library review questions).doc
- c语言基础知识题(The basic knowledge of C language problems).doc
- c语言头文件解析(C language header file parsing).doc
- c语言学习心得(C language learning experience).doc
文档评论(0)