




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、程序設(shè)計(jì)I實(shí)驗(yàn)實(shí)驗(yàn)5:選擇語句(下)實(shí)驗(yàn)?zāi)康?掌握布爾型變量的定義和用法 掌握關(guān)系運(yùn)算符、邏輯運(yùn)算符的運(yùn)用 穩(wěn)定if-else分支構(gòu)造的運(yùn)用 練習(xí)switch語句的用法實(shí)驗(yàn)內(nèi)容1 Using the & and | operator Write a program that reads an integer n and determines whether it is divisible by 5 and 6, whether it is divisible by 5 or 6, and whether it is divisible by 5 or 6, but not both.
2、Input An integer n in one line. Output The result in 3 lines like the Sample Output. Sample Input 10 Sample Output Is 10 divisible by 5 and 6? false Is 10 divisible by 5 or 6? true Is 10 divisible by 5 or 6, but not both? True實(shí)驗(yàn)內(nèi)容2Find the max and min讀入假設(shè)干整數(shù),找出其中的最大值和最小值。讀入假設(shè)干整數(shù),找出其中的最大值和最小值。Input輸入
3、的第一行為一個(gè)數(shù)輸入的第一行為一個(gè)數(shù)N,表示即將輸入的數(shù)字的個(gè)數(shù),表示即將輸入的數(shù)字的個(gè)數(shù)(2 = N = 1000)。接下來有。接下來有N行,每一行一個(gè)整數(shù)行,每一行一個(gè)整數(shù)a( 0= a 32767).Output輸出僅包括一行,格式如下輸出僅包括一行,格式如下max min其中其中max為輸入的為輸入的N個(gè)數(shù)中的最大值,個(gè)數(shù)中的最大值,min為輸入的為輸入的N個(gè)數(shù)中的最小值。個(gè)數(shù)中的最小值。 Sample Input212Sample Output1實(shí)驗(yàn)內(nèi)容3 Sorting three integers Write a program that reads three integers
4、 num1, num2, num3, and sort the numbers so that num1 = num2 = num3. Input Three integers num1, num2, num3 in one line. Output The sorted three numbers seperated by one blank in one line. Sample Input 1 3 2 Sample Output 1 2 3實(shí)驗(yàn)內(nèi)容4Finding the number of days in a monthWrite a program that reads month
5、and year, then displays the number of days in the month. For example, if the user entered month 2 and year 2000, the program should display that February 2000 has 29 days. If the user entered month 3 and year 2019, the program should display that March 2019 has 31 days.InputTwo numbers a, b(seperated by one blank), a for the year, b for the month.OutputThe result in one line.Sample In
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 電商平臺(tái)法定代表人履歷表模板范文
- 文化藝術(shù)教育教師信息技術(shù)應(yīng)用能力提升計(jì)劃
- 綜合辦公室在財(cái)務(wù)管理中的角色與職責(zé)
- 食品安全與質(zhì)量控制題
- 航空旅游業(yè)假期旅游出行證明(7篇)
- 三年級(jí)作文未來的鋼筆11篇范文
- 一年級(jí)閱讀興趣培養(yǎng)方案
- 普外科導(dǎo)管護(hù)理管理
- 2024-2025學(xué)年蘇教版二年級(jí)數(shù)學(xué)下冊(cè)知識(shí)點(diǎn)復(fù)習(xí)計(jì)劃
- 高校迎新晚會(huì)節(jié)目流程
- 醫(yī)療器械(耗材)項(xiàng)目投標(biāo)服務(wù)投標(biāo)方案(技術(shù)方案)
- GB/T 2077-2023硬質(zhì)合金可轉(zhuǎn)位刀片圓角半徑
- 病理科危險(xiǎn)化學(xué)品管理制度
- 二人相聲小品搞笑臺(tái)詞二人最搞笑的相聲臺(tái)詞
- 家具維保服務(wù)投標(biāo)方案
- 環(huán)保管家服務(wù)投標(biāo)方案(技術(shù)標(biāo))
- 電氣工程概論-肖登明
- 民間個(gè)人借款還清證明范本
- Sibelius使用教程教材說明
- 柔力球-華中師范大學(xué)中國(guó)大學(xué)mooc課后章節(jié)答案期末考試題庫(kù)2023年
- ASME-B31.3-2008-工藝管道壁厚計(jì)算
評(píng)論
0/150
提交評(píng)論