ImageVerifierCode 换一换
格式:DOCX , 页数:131 ,大小:1.08MB ,
资源ID:15340989      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/15340989.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(成都信息工程学院C语言作业答案Word文档格式.docx)为本站会员(b****1)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

成都信息工程学院C语言作业答案Word文档格式.docx

1、程序的运行效果应类似地如图1所示,图1中的3是从键盘输入的内容。#include int main(void)int x;double y;Please input x:);scanf(%d, &x);if (x 0)y = (double) 2 * x - 1;elseif (x = 0)y = (double) 7909;y = (double) - 5 * x + 27;nF(%d) = %.0lfn, x, y);return 0;2. P1-113已知某银行整存整取存款不同期限的年息利率分别为:3.15%期限一年,3.63%期限二年,4.02%期限三年,4.69%期限五年,5.36%

2、期限八年。从键盘上输入存钱的本金(以元为单位,必须定义为int且应考虑金额很大的情况)和存款期限(只考虑1,2,3,5,8),求到期时能从银行得到的利息(以元为单位,应考虑有小数,不计复利)。编程可用素材:nPleasebenjin,cunqi:).、printf(nlixi=.yuan.。程序的运行效果应类似地如图1所示,图1中的10000,8是从键盘输入的内容。 int benjin, cunqi; double lixi; double money; printf(nPlease input benjin,cunqi: scanf(%d,%dbenjin, &cunqi); money

3、= benjin; if ( cunqi = 1 ) lixi = money * cunqi * 3.15 / 100; else if ( cunqi = 2 ) lixi = money * cunqi * 3.63 / 100; else if ( cunqi = 3 ) lixi = money * cunqi * 4.02 / 100; else if ( cunqi = 5 ) lixi = money * cunqi * 4.69 / 100; else if ( cunqi = 8 ) lixi = money * cunqi *5.36 / 100; nlixi = %.2

4、f yuann, lixi); return 0;3. P1-114编写一个简单计算器程序,输入格式为:data1opdata2。其中data1和data2是参加运算的两个数(data1、data2必须定义为int,但二者相加可能超出int能表示的范围),op为运算符,它的取值只能是+、-、*、/、%。程序的运行效果应类似地如图1、图2、图3、图4所示,图1中的3000+2000、图2中的3000%2000、图3中的30000和图4中的3000/0是从键盘输入的内容。int main( void ) int data1, data2; double jieguo; char op;nPleas

5、e input data1 op data2:%d %c %ddata1, &op, &data2); switch ( op ) case +: jieguo = ( double ) data1 + data2; printf(n%d%c%d=%.0fn, data1, op, data2, jieguo); break;- jieguo = ( double ) data1 - data2;* jieguo = ( double ) data1 * data2;/ if ( data2 != 0 ) jieguo = ( double ) data1 / data2; printf( b

6、reak;nError! chu shu wei 0.n% jieguo = data1 % data2; default:n4.输入月份,打印2003年该月有几天。当输入的月份超范围时,应显示“Invalidmonthinput”。程序的运行效果应类似地如图1和图2所示,图1中的4和图2中的13是从键盘输入的内容。 int month; int day;nplease input the month number:month); switch ( month ) case 1: case 3: case 5: case 7: case 8: case 10: case 12: day = 3

7、1;n2003.%d has %d days.n, month, day); case 4: case 6: case 9: case 11: day = 30; case 2: day = 28;nInvalid month inputn 5.已知某公司员工的保底薪水为500,某月所接工程的利润profit(整数)与利润提成的关系如下(计量单位:元):profit1000没有提成;1000profit2000提成10%;2000profit5000提成15%;5000profit10000提成20%;10000profit提成25%。请根据输入的利润计算员工的薪水。程序的运行效果应类似地如图

8、1所示,图1中的2000是从键盘输入的内容。 int profit; double salary = 500;nInput profit:profit); if ( profit 1000 & profit = 2000 ) salary = salary + profit * 0.1; 2000 &= 5000 ) salary = salary + profit * 0.15; 5000 &= 10000 ) salary = salary + profit * 0.2; 10000 ) salary = salary + profit * 0.25;salary=%.2fn, salary);6.编写一程序P7-708.C实现以下功能输入一个三位正整数,然后逆序输出。如输入123,则输出321。程序的运行效果应类似地如图1所示,图1中的752是从键盘输入的内容。#includestdlib.h/*int main(void) int num, i; char str4;Input an integer:num); itoa(num, str, 10);The result is for(i = 2; i = 0; i-) printf(%c, stri);*/ int num; do, num%10); num = num/10; while (num); print

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1