E__homework_2678C_第4次作业_119074266_作业+4

合集下载

homework参考答案

homework参考答案

prepare an orange;
P(empty);
P(empty);
put an apple on the plate; put an orange on the plate;
V(apple ); }}
V (orange); }}
第二章
son(){ while(1) { P(orange);
daughter(){ while(1) { p(apple); take an apple from the plate; v(empty); eat the apple; }}
P(Emptyseat); P(mutex); 查登记表,登记姓名,座 位号等;
V(mutex);
阅读; P(mutex); 查登记表,置空;
V(mutex); 离开;
V(Emptyseat); }
哲学家就餐问题
➢给所有哲学家编号,奇数号的哲学家必 须先拿左边的筷子,偶数号的哲学家必 须先拿右边的筷子。
2.8
3
10.4 0.5 13.0 13.5 3.1
6.2
4
10.5 0.3 13.5 13.8 3.3
11.0
平均周转时间: (2.0+2.8+3.1+3.3)/4=2.8 • 平均带权周转时间:
(2.0+2.8+3.1+3.3)/4=2.8
第三章
(2)采用短作业优先调度算法,则其调度顺序是1、 4、3、2
,总的运行时间为:
20+30+10 + 40+20+10 + 10+30+20=190ms 其程序运行时间关系图如下图所示:
第一章

第3-4次作业 答案操作系统 大学课程 作业

第3-4次作业 答案操作系统 大学课程 作业
0 0 0 0
0 3 3 0
1 0 0 2
0 0 2 0
0 6 4 2
这时如果P0先归还它占有的(0 0 1 2),那么available的值是(1 1 1 2),可以找到一个执行次序p0,p2,p1,p3,p4保证所有进程都可以安全执行完,会处于安全状态,因此这个请求会被满足。
附加题
1.N个进程共享M个资源,一次只能保留或者释放一个资源。每个进程最大需要单元的数目不超过M,并且所有的最大需求的总和小于M+N。说明不会发生死锁。
第三次作业
7.1什么是忙等待?操作系统中其他种类的等待有什么?忙等待是否可以完全避免?为什么?
答:所谓忙等待是不断测试等待一个条件满足。
除了忙等待之外,操作系统中还有一种等待是让进程在等待状态阻塞等待一个条件满足,当条件满足时,通过中断告知进程。
忙等待的进程浪费CPU的时间,降低了效率,并且有可能导致优先级反转。但是并不能完全避免忙等待。如果在等待时间不是很长,并且系统内部进程的数量小,并且对CPU利用率要求不高的无优先级或者不同优先级的进程不会有同一个临界区的小型系统而言,可以考虑使用忙等待的方式解决简单的问题。另外,在多CPU的小型系统中,忙等待所导致的优先级反转的问题并不存在,因此这样的有优先级的小型系统也可以使用忙等待。
Semaphore bucket=3, well=1, jar=10, empty=1, full=0;
Void littlemonk()
{
while(1)
{
wait(empty);
wait(bucket);
wait(well);
取水;
signal(well);
wait(jar);
放水;
signal(jar);

课件计算机应用基础第四次作业答案.docx

课件计算机应用基础第四次作业答案.docx

一、单项选择题(只有一个选项正确,共17道小题)1. 在Word 的编辑状态,要将文档中选定的文字移动到指定位置去,首先对它进展的操作是单击______。

(A) "编辑"菜单下的"复制"命令(B) "编辑"菜单下的"去除"命令(C) "编辑"菜单下的"剪切"命令(D) "编辑"菜单下的"粘贴"命令你选择的答案:C [正确]正确答案:C解答参考:2. Word程序启动后就自动翻开一个名为______的文档。

(A) Noname(B) Untitled(C) 文件1(D) 文档1你选择的答案:D [正确]正确答案:D解答参考:3. 在Word的编辑状态下,连续进展了两次'插入'操作,当单击一次'撤消'按钮后______。

(A) 将两次插入的内容全部取消(B) 将第一次插入的内容全部取消(C) 将第二次插入的内容全部取消(D) 两次插入的内容都不被取消你选择的答案:D [错误]正确答案:C解答参考:4. 退出Word 2003 环境的最快方法是单击窗口按钮____ 。

(A)(B)(C)(D)你选择的答案:A [错误]正确答案:D解答参考:5. 在Excel 2003中,假定单元格B2和B3的值分别为6和12,那么公式=2*(B2+B3)的值为______。

(A) 36(B) 12(C) 24(D) 6你选择的答案:C [错误]正确答案:A解答参考:6. 在Excel 2003中,选择一块单元格区域后,假设要实现合并及居中的功能那么最少需要单击格式工具栏中相应的______。

(A) 2个按钮(B) 3个按钮(C) 4个按钮(D) 1个按钮你选择的答案:D [正确]正确答案:D解答参考:7. PowerPoint中,为某一张幻灯片修改设计模板效果的操作方法是_______。

大学英语第四次作业及答案

大学英语第四次作业及答案

大学英语第四次作业及答案R2开始时间2013年09月29日星期日09:09完成于2013年09月29日星期日09:35耗时26 分钟7 秒分数20.0/20.0成绩100.0/满分100.0反馈您已完成答题!具体成绩和答案会在测验截至后公布。

窗体顶端题目1正确获得1.0分中的1.0分Flag question题干I was satisfied with her explanation, _________.选择一项:a. so were my classmatesb. so did my classmatesc. so my classmates didd. so my classmates were题目2正确获得1.0分中的1.0分Flag question题干We all thought ____ a pity that you were unable to attend our meeting.选择一项:a. thatb. thisc. itd. which题目3正确获得1.0分中的1.0分Flag question题干When father was young, he ______from morning till night. 选择一项:a. was made workingb. made to workc. was made workd. was made to work题目4正确获得1.0分中的1.0分Flag question题干Would you like something_________ ?选择一项:a. drinkingb. for drinkingc. drinkd. to drink题目5正确获得1.0分中的1.0分Flag question题干What a bad memory I've got! I even forgot ____the book with me. 选择一项:a. takenb. takec. takingd. to take题目6正确获得1.0分中的1.0分Flag question题干The children _______ play with them.选择一项:a. want me forb. want that Ic. want me tod. are wanting that题目7正确获得1.0分中的1.0分Flag question题干The film brought the hours back to me ______ I was taken good care of in that remote village. 选择一项:a. untilb. whenc. thatd. where题目8正确获得1.0分中的1.0分Flag question题干_______ him go out if he wants to.选择一项:a. Letb. Permitc. Leaved. Allow题目9正确获得1.0分中的1.0分Flag question题干I hate the news, _____made us very sad.选择一项:a. whichb. whatc. itd. that题目10正确获得1.0分中的1.0分Flag question题干The reason I didn't go to Canada was _______ a new job. 选择一项:a. how I gotb. that I gotc. because I gotd. why I got题目11正确获得1.0分中的1.0分Flag question题干It was a great pleasure ________ me to be invited to the party. 选择一项:a. forb. toc. ofd. on题目12正确获得1.0分中的1.0分Flag question题干I don't know _______ to deal with such matter.选择一项:a. whatb. whichc. /d. how题目13正确获得1.0分中的1.0分Flag question题干You'd better ______in bed. It's bad for your eyes.选择一项:a. not readb. don't readc. readd. not to read题目14正确获得1.0分中的1.0分Flag question题干Did you notice the guy ______ head looked like a big potato? 选择一项:a. whob. whosec. whomd. which题目15正确获得1.0分中的1.0分Flag question题干After the Minister of Education had finished speaking at the press conference, he was made ____all sorts of awkward questions.选择一项:a. answerb. to answerc. answeredd. answering题目16正确获得1.0分中的1.0分Flag question题干He put forward a theory, _______ of great importance to the progress of science and technology. 选择一项:a. I think it isb. which is I thinkc. I think which isd. which I think is题目17正确获得1.0分中的1.0分Flag question题干Miss Wang wanted to know _______for the film.选择一项:a. why was he lateb. why he was latec. why is he lated. .why he is late题目18正确获得1.0分中的1.0分Flag question题干His salary as a driver is much higher than ________. 选择一项:a. is a porterb. as a porterc. a porterd. that of a porter题目19正确获得1.0分中的1.0分Flag question题干It is the best ______ I have seen.选择一项:a. thatb. whoc. whomd. which题目20正确获得1.0分中的1.0分Flag question题干Don't forget ________ the window before leaving the room. 选择一项:a. to have closedb. to closec. closingd. having closed窗体底端。

《计算机应用基础》1-3次作业

《计算机应用基础》1-3次作业

《计算机应用基础》1-3次作业计算机应用基础第1-3次作业作业一:________计算机硬件基础1.1 主板主板是计算机的核心部件,负责连接所有硬件设备和处理器。

1.1.1 常见主板类型●ATX主板:________最常见的主板类型,适用于大多数桌面计算机。

●mATX主板:________小型化的ATX主板,适用于小尺寸计算机壳体。

具有较少的扩展插槽。

●ITX主板:________更小型化的主板,适用于小型电脑和嵌入式系统。

1.1.2 主板组成部分●芯片组:________负责连接处理器、内存和其他设备,在主板上发挥桥梁作用。

●插槽和插座:________用于安装处理器、内存和扩展卡。

●连接器:________连接各种硬件设备,如硬盘、显示器、键盘等。

●BIOS芯片:________存储基本输入输出系统(BIOS)程序,负责启动计算机。

作业二:________操作系统基础2.1 操作系统概述操作系统是计算机系统的核心软件,负责管理计算机的硬件和软件资源,提供用户和计算机之间的接口。

2.2 常见操作系统类型●Windows操作系统:________由微软公司开发,广泛用于个人电脑。

●macOS:________由苹果公司开发,用于苹果电脑。

●Linux:________开源操作系统,适用于各种计算机设备。

2.3 操作系统功能●进程管理:________负责进程的创建、调度和终止。

●内存管理:________管理计算机的内存资源,包括内存分配和释放。

●文件系统:________提供对文件的管理和操作。

●设备管理:________管理计算机的硬件设备,如打印机、网络适配器等。

作业三:________常见应用软件3.1 办公软件办公软件是用于办公任务的软件,包括文字处理、表格计算、幻灯片演示等功能。

3.1.1 Microsoft OfficeMicrosoft Office是一款常用的办公软件套装,包括Word、Excel和PowerPoint等多个组件。

homework_04

homework_04

Homework 04Student Name: Student No.:Your file name should be: your name_your student number. For example: lucy_123456.docI. Multiple Choice (Select the best answer)1. A(n) __c___ has a design that reduces the chance of wrist and hand injuries.a. gaming keyboardb. cordless keyboardc. ergonomic keyboardd. function key2. Some phones use __a___, where you press one key on the keypad for each letter in a word and software on the phone predicts the word you want.a. predictive text inputb. text messagingc. ergonomicsd. optical character recognition (OCR)3. Touch screens that recognize multiple points of contact at the same time are known as __b___.a. touch-sensitive padsb. multi-touchc. graphics tabletsd. digitizers4. Architects, mapmakers, designers, artists, and home users create drawings and sketches on a __c___.a. trackballb. terminalc. graphics tabletd. touchpad5. __d___ is the computer’s capability of distinguishing spoken words.a. Voice inputb. VoIPc. MIDId. Voice recognition6. ___c__ allows users to record, compose, mix, and edit music and sounds.a. Kiosksb. Voice inputc. Music production softwared. Voice recognition7. RFID is a technology that uses __c___ to communicate with a tag placed in or attached to an object, an animal, or a person.a. a thin wireb. pixelsc. radio signalsd. light waves8. With ___c__, the computer will detect human motions.a. a head-mounted pointerb. an on-screen keyboardc. gesture recognitiond. a computerized implantII. Short Answer (Write a brief answer to each of the following questions)1.What are three different types of mouse devices?Optical mouse, laser mouse and wireless mouse.What makes them different from each other?An optical mouse uses devices that emit and sense light to detect the mouse’s movem ent. A laser mouse uses a laser and is more expensive than an optical mouse. An air mouse allows you to control objects, media players, and slide shows by moving the mouse in predetermined directions through the air. A wireless mouse, or cordless mouse, transmits data using wireless technology. at least five mouse operations.Point,click,right-click,double-click and triple click.Describe and give examples of each of the mouse operations that you chose.PointMove the mouse until the pointer on the desktop is positioned on theitem of choice.Example:position the pointer on the screen.ClickPress and release the primary mouse button, which usually is the leftmouse button.Example:select or deselect items on the screen orstart a program or program feature.Right-clickPress and release the secondary mouse button, which usually is the rightmouse button.Example:display a shortcut menu.Double-clickQuickly press and release the left mouse button twice without movingthe mouse.Example:start a program or program feature.Triple-clickQuickly press and release the left mouse button three times withoutmoving the mouse.Example:select a paragraph.3.What is OCR (optical character recognition)?It is software that enables scanners to read and convert text documents into electronic files.What is OMR (optical mark recognition)?It is optical reader technology that reads hand-drawn marks such as small circles or rectangles.4. What is the most widely used biometric device today?The most widely used biometric device today is a fingerprint reader.Describe how the device works.It captures curves and indentations ofa fingerprint (Figure 5-37). The reader can beset up to perform different functions for dif-ferent fingers.4.What is the Americans with Disabilities Act (ADA)?It is federal law that requires any company with 15 or more employees to make reasonable attempts to accommodate the needs of physically challenged workers.How might gesture recognition and computerized implant devices help physically challenged users in the future?Both in the prototype stage, they attempt to provide users with a natural computer interface. With gesture recognition, the computer will detect human motions. Computers with gesture recognition capability have the potential to recognize sign language, read lips, track facial movements, or follow eye gazes. For paralyzed or speech impaired individuals, a doctor will implant a computerized device into the brain. This device will contain a transmitter. As the user thinks thoughts, the transmitter will send signals to the computer.III. True/False (Mark T for True and F for False)__T___ 1. Once data is in memory, the computer interprets and executes instructions to process the data into information.___T__ 2. An input device is any hardware component that allows users to enter data and instructions into a computer.___F__ 3. The command associated with a function key performs the same task within each program with which you are interacting.___T__ 4. A touchpad is a small, flat, rectangular pointing device that is sensitive to pressure and motion.___T__ 5. Touch-sensitive pads typically contain buttons and/or wheels that are operated with a thumb or finger.___F__ 6. To capture a signature, a user speaks his or her name into a signature capture pad.___F__ 7. Resolution is the smallest element in an electronic image.___F__ 8. A whiteboard is a meeting between two or more geographically separated people who use a network or the Internet to transmit audio and video data.___F__ 9. Scanners capture data from a target document, which is the original form of the data.___T__ 10. A flatbed scanner works in a manner similar to a copy machine except it creates a file of the document in memory instead of a paper copy.___T__ 11. A DVD kiosk is a self-service DVD rental machine that connects to a host computer through a network.___T__ 12. A keyguard is a metal or plastic plate placed over the keyboard that allows users to rest their hands on thekeyboard without accidentally pressing any keys.。

(精华版)国家开放大学电大《C语言程序设计》网络课形考网考作业及答案

(精华版)国家开放大学电大《C语言程序设计》网络课形考网考作业及答案

(精华版)国家开放大学电大《C语言程序设计》网络课形考网考作业及答案(精华版)国家开放大学电大《C语言程序设计》网络课形考网考作业及答案100%通过考试:2022年秋期电大把该网络课纳入到“国开平台”进行考核,该课程共有4个形考任务,针对该门课程,本人汇总了该科所有的题,形成一个完整的标准题库,并且以后会不断更新,对考生的复习、作业和考试起着非常重要的作用,会给您节省大量的时间。

做考题时,利用本文档中的查找工具,把考题中的关键字输到查找工具的查找内容框内,就可迅速查找到该题答案。

本文库还有其他网核及教学考一体化答案,敬请查看。

课程总成绩=形成性考核某50%+终结性考试某50%形考任务1一、选择题〔共40分,每题2分〕题目1在每个C语言程序中都必须包含有这样一个函数,该函数的函数名为〔〕。

选择一项: A.main恭喜你,答对啦!!题目2C语言源程序文件的缺省扩展名为〔〕。

选择一项: D.c题目3由C语言目标文件连接而成的可执行文件的缺省扩展名为〔〕。

选择一项: B.e某e题目4程序运行中需要从键盘上输入多于一个数据时,各数据之间应使用的分隔符为〔〕。

选择一项: D.空格或回车题目5每个C语言程序文件的编译错误被分为〔〕。

选择一项: B.2类题目6不符合C语言规定的复合语句是〔〕。

选择一项: D.{y=10}题目7C语言程序中的根本功能模块为〔〕。

选择一项: D.函数题目8在一个函数定义中,函数头包括的3个局部依次为函数类型、函数名和〔〕。

选择一项: C.参数表题目9在一个程序文件中,假设要使用#include命令包含一个用户定义的头文件,那么此头文件所使用的起止定界符为一对〔〕。

选择一项: B.双引号题目10在C语言程序中,多行注释语句使用的开始标记符为〔〕。

选择一项: B./某题目11在printf()函数调用的格式字符串中,假设使用格式符为“%c”,那么对应输出的数据类型为〔〕。

选择一项: A.char题目12在printf()函数调用的格式字符串中,假设使用格式符为“%5d”,那么规定对应输出的数据占用的字符位置个数为〔〕。

“PEP”2024年小学四年级上册第4次英语第四单元暑期作业(含答案)

“PEP”2024年小学四年级上册第4次英语第四单元暑期作业(含答案)

“PEP”2024年小学四年级上册英语第四单元暑期作业(含答案)考试时间:80分钟(总分:140)A卷考试人:_________题号一二三四五总分得分一、综合题(共计100题共100分)1. 选择题:What do we call the first meal of the day?A. LunchB. DinnerC. BreakfastD. Snack2. 填空题:I like to collect _______.3. 选择题:What do you call a person who studies animals?A. BiologistB. ZoologistC. EcologistD. Ornithologist4. 填空题:Plants can help us learn about ______ (科学).5. 听力题:I have a ______ for math. (test)6. 选择题:What type of animal is a dolphin?A. FishB. AmphibianC. MammalD. Reptile答案: CA snake can be very ______.8. 选择题:What is the term for a person who is trained to treat animals?A. VeterinarianB. DoctorC. ZookeeperD. Biologist答案:A9. 听力题:A _______ is a measure of how much energy is needed to change temperature.10. 选择题:What do you call a young seal?A. PupB. KitC. CalfD. Cub11. 填空题:My cousin lives in ____.12. 选择题:What do you call a person who teaches students?A. DoctorB. TeacherC. ChefD. Engineer答案:B13. 听力题:The chemical symbol for silver is ______.14. 填空题:My sister has a __________ (可爱的) smile.15. 选择题:What do we call a collection of stars?A. GalaxyB. UniverseC. PlanetariumD. Solar System答案:AWe can _______ (一起) do yoga.17. 选择题:What do we call a person who cleans houses?A. GardenerB. CleanerC. ChefD. Mechanic18. 填空题:The _______ (The Berlin Conference) divided Africa among European powers.19. 填空题:My backpack is filled with ______.20. 听力题:The chemical formula for nitrogen trioxide is _______.21. 听力题:The ________ (experience) was unforgettable.22. 填空题:In the evening, I help my mom ________ (做饭). We prepare a delicious ________ (晚餐) together.23. 填空题:A dolphin can recognize itself in a ________________ (镜子).24. 选择题:What do we call a large, flying bird?A. SparrowB. EagleC. PenguinD. Ostrich25. 听力题:The __________ is the measure of how much solute is dissolved in a solution.26. 听力题:She loves to _____ (dance/sing) at parties.27. 听力题:The flowers smell _____ (sweet/bad).The boy likes ________.29. environmental awareness) promotes stewardship. 填空题:The ____30. 填空题:My friend enjoys _______ (动词) on weekends. 她的活动很 _______ (形容词).31. 听力题:We eat ______ (breakfast) in the morning.32. 填空题:The __________ (历史的动力) often comes from change.33. 听力题:My sister enjoys listening to ____ (music) while studying.34. 填空题:A _____ (蝙蝠) can fly at night and uses echo location.35. 填空题:In school, we have a library where we can borrow ______ (书籍). I love discovering new stories.36. 选择题:What is the name of the famous explorer who sailed across the Pacific?A. Ferdinand MagellanB. Christopher ColumbusC. Vasco da GamaD. James Cook37. 填空题:The _______ (鸽子) coos softly.38. 选择题:What do we call a person who makes bread?A. BakerB. ButcherC. ChefD. Cook39. 填空题:A _____ (果树) produces fruit each year.40. 选择题:What do you wear on your head?A. ShoesB. HatC. ShirtD. Pants41. 填空题:The sea horse is a unique _______ (生物).42. 填空题:The ________ is known for its beautiful feathers.43. 听力题:I see a _____ (朋友) at the coffee shop.44. 填空题:________ (生态系统动态) guide conservation.45. 听力题:We are _______ (going) to a concert.46. 听力题:An animal that eats only plants is called a ______.47. 听力题:The freezing point of water is _____ degrees Celsius.48. 填空题:My sister enjoys __________ (科学实验).49. 填空题:We have a ______ (丰富的) schedule filled with activities.50. 听力题:The __________ is a feature of deserts.51. 小狼) runs fast in the wild. 填空题:The ___52. 听力题:The playground is ___ (fun) to play in.53. 选择题:Which is the largest planet in our solar system?A. EarthC. SaturnD. Mars答案:B. Jupiter54. 选择题:What is the capital city of Kazakhstan?A. AlmatyB. Nur-SultanC. ShymkentD. Aktobe55. 选择题:What do we call a baby cow?A. CalfB. KitC. LambD. Foal答案:A56. 听力题:The book is on the ___ (table).57. 填空题:The _____ (四季变化) influences plant life cycles.58. 听力题:Jupiter has a famous storm called the Great _______ Spot.59. 听力题:Heat can make things ______ (expand).60. 听力题:A solution is a mixture where one substance ______ in another.61. 选择题:What is the name of the famous festival celebrated in India?A. ChristmasB. DiwaliC. HalloweenD. Thanksgiving答案:B62. 选择题:What do you call a place where you can see art?A. LibraryC. TheaterD. Park答案: B63. 填空题:My sister likes to sing __________. (歌曲)64. 填空题:My brother is a _____ (学生) who excels in math.65. 听力题:The process of ______ involves the gradual breakdown of rocks.66. 听力题:The ocean is _____ (deep/shallow).67. 填空题:The __________ is a large forest in Germany. (黑森林)68. 填空题:A zebra's stripes help it confuse ________________ (捕食者).69. sustainable development) meets present needs without harming future generations. 填空题:The ____70. 选择题:What do you call a baby alligator?A. HatchlingB. PupC. CalfD. Kit答案: A71. 听力题:I wear _____ (耳环) for special occasions.72. 选择题:What do you call the fear of heights?A. AcrophobiaB. ClaustrophobiaC. AgoraphobiaD. Nyctophobia答案:AThe _______ (青蛙) croaks loudly at night.74. 选择题:What is the capital of Spain?A. BarcelonaB. MadridC. ValenciaD. Seville答案: B75. 听力题:Chemical properties describe how a substance interacts with other ________.76. 听力题:The chemical formula for decanoic acid is ______.77. 选择题:What do you call the process of a seed growing into a plant?A. GerminationB. PhotosynthesisC. PollinationD. Fertilization答案:A78. 听力题:A catalyst is not consumed in a ______ reaction.79. 听力题:The __________ is known for its beautiful sunsets.80. 填空题:I love to _______ (写) letters to my friends.81. 选择题:What do you call the first book in the Bible?A. GenesisB. ExodusC. LeviticusD. Numbers答案:A82. 填空题:She is a dancer, ______ (她是一位舞者), and performs on stage.A _______ (小松鼠) hoards food for winter.84. 听力题:I want to ________ my friends.85. ts are known for their ______ leaves, which can trap moisture. (一些植物以其厚重的叶子而闻名,这些叶子可以捕捉水分。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

作业 4
1、输入一个正整数n,再输入n个学生的成绩,计算平均分,并统计不及格成绩的个数。

#include "stdio.h"
#include "conio.h"
main()
{ int Failed,i,n;
float Mark,Sum;
printf("Please input n:");
scanf("%d",&n);
Failed=Sum=0;
for(i=1;i<=n;i++)
{
printf("Please input Mark %d:",i);
scanf("%f",&Mark);
Sum=Sum+Mark;
if(Mark<60)
Failed++;
}
printf("aver=%f\n",Sum/n);
printf("Failed=%d\n",Failed);
getch();
}
.
2、输入一个职工的月薪salary,输出应交的个人所得税tax(保留两位小数)。

计算方法:tax=rate(salary-850)/100
当salary≤850时,rate=0;
当850 <salary≤1350时,rate=5;
当1350 <salary≤2850时,rate=10;
当2850 <salary≤5850时,rate=15;
当5850 <salary时,rate=20;
#include "stdio.h"
#include "conio.h"
main()
{ double money,rate,Tax;
printf("Please input money:");
scanf("%lf",&money);
if(money<=850)
rate=0;
else if(money<=1350)
rate=5;
else if(money<=2850)
rate=10;
else if(money<=5850)
rate=15;
else
rate=20;
Tax=rate*(money-850)/100 ;
printf("Tax=%.2f",Tax);
getch();
}。

相关文档
最新文档