《大学c语言实验作业.pdf》由会员分享,可在线阅读,更多相关《大学c语言实验作业.pdf(8页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、实验 4:(1)编程计算如下的函数:y=2/x,当 x0;y=0,当 x=0;y=2x,当 x0。用 scanf函数输入 x 的值,求 y 值。:(2)给出一个百分制成绩,要求输出成绩等级A、B、C、D、E。90 分以上为 A,8189 分为 B,7079 分为 C,6069分为下为 E。编好程序,要求分别用if 语句和 switch 语句来实现。运行程序,并检查结果是否正确。用 if 语句:用 switch语句:再运行一次程序,输入分数为负值(如70),这显然是输入时出错,不应该给出等级,修改程序,使之能正确处理任何数据,当输入数据大于100 和小于 0 时,通知用户“输入数据错”,程序结束
2、。输入数据错:(3)编写一个程序,将用户输入的24h 计时法转换位 12h 计时法。例如:若输入14:2:15,则输出 2:2:15PM;若输入 3:1:14,则输出 3:1:14AM。程序应能检查输入的错误,如:37:60:78等。Ps:老师,上边的这个程序我开始的时候这样编写,但是当输入大于12 的数据的时候怎么还是以原来的数据输出了啊,不懂,我感觉应该没错啊这样也不行啊!(4)输入 4 个整数,要求按由小到大顺序输出。实验 5:(1)输入两个正整数m 和 n,求它们的最大公约数和最小公倍数在运行时,输入的值mn,观察结果是否正确。再输入时,使 mn,观察结果是否正确。修改程序,不论 m
3、和 n 为何值(包括负整数),都能得到正确结果。文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9
4、ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档
5、编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N
6、10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K
7、9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8
8、文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M
9、7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8(2)试编程求解 1000以内的完全数。如果一个数恰好等于它的因子之和,则称该数为完全数。如 6=1+2+3(3)用牛顿迭代法求方程2x3-4x2+3x-6=0 在 1.5 附近的根。在得到正确结果后,请修改程序使所
10、设的 x 初始值由 1.5改变为 100、1000、10000,再运行,观察结果,分析不同的x 初值对结果有没有影响,为什么?修改程序,使之能输出迭代的次数和每次迭代的结果,分析不同的x 初始值对迭代的次数有无影响。x=1.5:X=100:X=1000:文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C
11、2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z
12、8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4
13、A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR
14、1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK
15、4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6
16、C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8x=100
17、00:不同的 x 值对结果影响不大(4)猴子吃桃问题。猴子第一天摘下若干个桃子,当即吃了一半,还不过瘾,又多吃了一个。第二天早上又将剩下的桃子吃掉一半,又多吃了一个。以后每天早上都吃了前一天剩下的一半零一个。到第10 天早上想再吃时,见只剩一个桃子。求第一天共摘了多少桃子。在得到正确结果后,修改题目,改为猴子每天吃了前一天剩下的一半后,再吃两个。请修改程序并运行,检查结果是否正确。实验 6:文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4
18、Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C
19、4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:C
20、R1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 H
21、K4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU
22、6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码
23、:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10
24、 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8(1)用选择法对 10 个整数排序。10 个整数用 scanf函数输入,并动态跟踪其实现过程。(2)有 15 个数按从小到大的顺序存放在一个数组中,输入一个数,要求用折半查找法找出该数是数组中第几个元素的值。如果该数不在数组中,则输出“无此数”。文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9
25、ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档
26、编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N
27、10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K
28、9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8
29、文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M
30、7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O
31、9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z83)将两个字符串连接起来,不要用strcat函数。(4)输入 N 个学生的学号及其5 门单科成绩,然后按总分从高到低排序后输出。(5)已知按升序排列好的字符串a,将字符串 s中的每个字符按升序的规则插到数组a中。字符串 s从键盘输入。试验七:文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8
32、文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M
33、7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O
34、9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6
35、Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L
36、7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K
37、9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5
38、D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8(1)写一个判别素数的函数,在主函数输入一个整数,输出是否素数的信息。本程序应当准备以下测试数据:17、34、2、1、0、-13。分别运行并检查结果是否正确。(2)用一个函数来实现将一行字符串中最长的单词输出。此行字符串从主函数传递给该函数。把两个函数放在同一个程序文件中,作为一个文件进行编译和运行。把两个函数分别放在两个程序文件中,作为两个文件进行编译、连接和运行。这儿将两个程序放入两个文件中,确实是不会,网上查了要保存成.pp 型的文件什么来着。老师您讲讲吧(3)用递归法将一个整数n 转换成字符串。例
39、如,输入483,应输出字符串”483”。n 的位数不确定,可以是任意的整数。(4)求两个整数的最大公约数和最小公倍数,用一个函数求最大公约数。用另一个函数根据求出的最大公约数求最小公倍数不用全局变量,分别用两个函数求最大公约数和最小公倍数。两个整数在主函数中输入,并传递给函数 1,求出的最大公约数返回主函数,然后再与两个整数一起作为实参数传递给函数2,以求出最小公倍数,返回到主函数输出最大公约数和最小公倍数。文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7
40、M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9
41、O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D
42、6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2
43、L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8
44、K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A
45、5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1
46、C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8用全局变量的方法,分别用两个函数求最大公约数和最小公倍数,但其值不由函数带回。将最大公约数和最小公倍数都设为全局变量,在主函数中输出它们的值。文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU
47、6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码
48、:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10
49、 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9
50、ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档编码:CR1C2L7M7N10 HK4Z8K9O9K9 ZU6C4A5D6Z8文档