freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

c語(yǔ)言課件第6章選擇結(jié)構(gòu)程序設(shè)計(jì)-資料下載頁(yè)

2024-10-04 16:19本頁(yè)面
  

【正文】 else { s=b*b4*a*c。 if (s=) if (s) {t=sqrt(s)。 x1=*(b+t)/a。 x2=*(bt)/a。 printf(There are two different roots:%f and%f\n ,x1,x2)。} else printf(There are two equal roots:%f\n,*b/a)。 else { t=sqrt(s)。 x1=*b/a。 x2=abs(*t/a)。 printf(There are two virtual roots:)。 printf(%f+i%f\t\t%fi%f\n,x1,x2,x1,x2 )。 } } } 例 已知某公司員工的保底薪水為 500, 某月所接工程的利潤(rùn)profit( 整數(shù) ) 與利潤(rùn)提成的關(guān)系如下 ( 計(jì)量單位:元 ) : profit≤1000 沒有提成 ; 1000< profit≤2022 提成 10%; 2022< profit≤5000 提成 15%; 5000< profit≤10000 提成 20%; 10000< profit 提成 25%。 算法設(shè)計(jì)要點(diǎn) : 提成的變化點(diǎn)都是 1000的整數(shù)倍 ( 1000、 202 5000、 …… ) ,如果將利潤(rùn) profit整除 1000, 則當(dāng): profit≤1000 對(duì)應(yīng) 0、 1 1000< profit≤2022 對(duì)應(yīng) 2 2022< profit≤5000 對(duì)應(yīng) 5 5000< profit≤10000 對(duì)應(yīng) 10 10000< profit 對(duì)應(yīng) 1 1 …… 為解決相鄰兩個(gè)區(qū)間的重疊問題 , 最簡(jiǎn)單的方法就是:利潤(rùn) profit先減 1( 最小增量 ) , 然后再整除 1000即可 : profit≤1000 對(duì)應(yīng) 0 1000< profit≤2022 對(duì)應(yīng) 1 2022< profit≤5000 對(duì)應(yīng) 4 5000< profit≤10000 對(duì)應(yīng) 9 10000< profit 對(duì)應(yīng) 1 1 …… main() { long profit。 int grade。 float salary=500。 printf(Input profit: )。 scanf(%ld, amp。profit)。 grade= (profit – 1) / 1000。 switch(grade) { case 0: break。 /*profit≤1000 */ case 1: salary += profit*。 break。 case 2: case 3: case 4: salary += profit*。 break。 case 5: case 6: case 7: case 8: case 9: salary += profit*。 break。 default: salary += profit*。 } printf(salary=%.2f\n, salary)。 } 例 運(yùn)輸費(fèi)用的計(jì)算 include include main() { int c, s。 float p, w, d, f。 printf(please input p,w,s:)。 scanf(%f,%f,%d,amp。p,amp。w,amp。s)。 if (s=3000) c=12。 else c=s/ switch (c) { case 0: d=0。break。 case 1: d=2。break。 case 2: case 3: d=5。break。 s: 路程 w: 貨物重量 p:運(yùn)價(jià) d: 折扣率 f: 總運(yùn)費(fèi) case 4: case 5: case 6: case 7:d=8。break。 case 8: case 9: case 10: case 11:d=10。break。 case 12:d=15。break。 } f=p*w*s*(1d/100) printf(Total freight is:%\n,f)。 } 同 學(xué) 們 再 見 程 序 設(shè) 計(jì) 基 礎(chǔ)
點(diǎn)擊復(fù)制文檔內(nèi)容
數(shù)學(xué)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1