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

正文內(nèi)容

邏輯運算和判斷選取控制(編輯修改稿)

2024-10-10 08:05 本頁面
 

【文章內(nèi)容簡介】 a=c=0。 b=1。 d=20。 if(a) d=d10。 else if(! b) if(! c) x=15。 else x=25。 printf(“%d\n”,d)。 } (題 )以下程序的運行結(jié)果是 ———— . include void main(void) { int x,y=1,z。 if(y! =0) x=5。 printf(“\t%d\n”,x)。 if(y= =0) x=4。 else x=5。 printf(“\t%d\n”,x)。 x=1。 12 if(y0) if(y0) x=4。 else x=5。 printf(“\t%d\n”,x)。 } (題 ) 以下程序的運行結(jié)果是 ———— . include void main(void) { int x,y=2,z=0。 if((z=y)0) x=4。 else if(y= =0) x=5。 else x=6。 printf(“\t%d\t%d\n” ,x,z)。 if(z=(y= =0)) x=5。 x=4。 printf(“\t%d\t%d\n”, x,z)。 if(x=z=y) x=4。 printf(“\t%d\t%d\n” ,x,z)。 } (題 )請閱讀下面的程序 : main() { int s,t,a,b。 scanf(“%d,%d”,amp。a,amp。b)。 s=1。 t=1。 if(a0) s=s+1。 if(ab) t=s+t。 else if(a= =b) t=5。 else t=2*s。 printf(“s=%d,t=%d”,s,t)。 } 為了使輸出結(jié)果 t=4,輸入量 a 和 b 應滿足的條件是【 】 . (題 ) 請閱讀下面的程序 : main() { int s,t,a,b。 scanf(“%d,%d”,amp。a,amp。b)。 s=1。 t=1。 if(a0) s=s+1。 if(ab) t=s+t 。 else if(a= =b) t=5。 else t=2*s。 printf(“s=%d,t=%d”,s,t)。 13 } 為了使輸出結(jié)果 s=1,t=5,輸入量 a 和 b 應滿足的條件是【 】 . (題 )下面程序根據(jù)以下函數(shù)關(guān)系 ,對輸入的每個 x值 ,計算出 y值 .請在【 】內(nèi)填入正確內(nèi)容 . x Y 2x=10 x(x+2) 1x=2 2x x=1 x1 main() { int x,y。 scanf(“%d”,amp。x)。 if(【 1】 ) y=x*(x+2)。 else if(【 2】 ) y=2*x。 else if(x=1) y=x1。 else 【 3】 。 if(y! = 1) printf(“%d”,y)。 else printf(“error”)。 } (題 )下面程序根據(jù)以下函數(shù)關(guān)系 ,對輸入的每個 x值 ,計算出相應的 y 值 ,請在【 】內(nèi)填入正確內(nèi)容 . x y x=a 或 x=a 0 axa Sqrt(a*ax*x) xa 或 xa x include”” main() { int x,a。 float y。 scanf(“%d %d”,amp。x,amp。a)。 if(【 1】 ) y=0。 else if(【 2】 ) y=sqrt(a*ax*x)。 else y=x。 printf(“%f”,y)。 } (題 )以下程序的功能是計算一元二次方程 ax2+bx+c=0 的根,請在【 】內(nèi)填入正確內(nèi)容。 14 include “” main() { float a,b,c,disc,twoa,terml,term2。 printf(“enter a,b,c”)。 scanf(“%f %f %f”,amp。a,amp。b,amp。c)。 if(【 1】 ) if(【 2】 ) printf(“no answer due to input error\n”)。 else printf(“the single root is%f\n”,c/b)。 else {disc=b*b4*a*c。 twoa=2*a。 term1=b/twoa。 t=abs(disc)。 term2=sqrt(t)/twoa。 if(【 3】 ) printf(“plex root\n real part=%f imag part=%f\n”,term1,term2)。 else printf(“real roots\n root1 =%f root2=%f\n”,term1+term2,term1term2)。 } } (題 )以下程序根據(jù)輸入的三角形的三邊判斷是否能組成三角形 ,若可以輸出它的面積和三角形的類型 .請在【 】內(nèi)填入正確內(nèi)容 . include “” main() { float a,b,c。 float s,area。 scanf(“%f %f %f”,amp。a,amp。b,amp。c)。 if(【 1】 ) { s=(a+b+c)/2。 area=sqrt(s*(s)*(sb)*(sc))。 printf(“%f”,area)。 if(【 2】 ) printf(“等邊三角形 ”) else if(【 3】 )。 printf(“等腰三角形 ”)。 else if((a*a+b*b= =c*c) | | (a*a+c*c= = b*b) | | (b*b+c*c= = a*a)) printf(“直角三角形 ”)。 else printf(“一般三角形 ”) } else printf(“不能組成三角形 ”)。 } (題 )某郵局對郵寄包裹有如下規(guī)定 :若包裹的長度高任一尺寸超過 1米或重量超過 30千克 ,不予郵寄 。對可以郵寄的包裹每件收手續(xù)費 元 ,再加上根據(jù)下表按重量 15 wei 計算的郵寄 : 重量 (千克 ) 收費標準 (元 ) Wei10 10Wei=20 20wei=30 請在程序的【 】內(nèi)填入正確內(nèi)容 . main() { float len,wei,hei,wid,mon,r。 scanf(“%f %f %f %f”,amp。len,amp。wid,amp。hei,amp。wei)。 if(len1 | | wid1 | | hei1 | | wei30) 【 1】 。 else if(wei10 ) r=。 else if(wei=20) r=。 else if(wei=30) 【 2】 。 if(r= = 1) printf(“error\n”)。 else {【 3】 。 printf(“%f”,mon)。} } (題 )某服裝店經(jīng)營套服,也單個出售。若買的不少于 50 套 80 元,不足 50 套的每套90 元;只買上衣每件 60元;只買褲子每條 45 元。以下程序的功能是讀入所買上衣 c 和褲子 t 的件數(shù),計 算應付款 m。請在【 】內(nèi)填入正確內(nèi)容。 main() { int c, t, m; printf(“ input the number of coat and trousers your want buy: \n”); scanf(“%d %d ,amp。s,amp。t”)。 if(【 1】 ) if(c=50) m=c*80。 else if(【 2】 ) if(t=50) m=t*80+(ct)*60。 else m=t*90+(ct)*60 else if(【 3】 ) m=c*80+(tc)*45。 else m=c*90+(tc)*45。 printf(“%d”,m)。 } (題 ) 以下程序的功能是判斷輸入的年份是否是閏年 .請在【 】內(nèi)填入正確內(nèi)容 . main() { int y,f。 16 scanf(“%d”,amp。y)。 if(y%400= =0) f=1。 else if(【 1】 ) f=1。 else 【 2】 。 if(f) printf(“%d is”,y)。 else printf(“%d is not”,y)。 printf(“a leap year \n”)。 } (題 )以下程序針對輸入的截止日期 (年 :yend,月 :mend, 日 :dend) 和出生日期(yman,mman,dman),計算出實際年齡 .請在【 】內(nèi)填入正確內(nèi)容 . 設有 :int yend,mend ,dend ,yman, mman,dman,age。 age=yend –yman。 if(mend【 1】 mman) age 。 else if(mend 【 2】 mman amp。amp。dend【 3】 dman) age 。 (題 )有四個數(shù) a,b,c,d,要求按從大到小的順序輸出 .請在【 】內(nèi)填入正確內(nèi)容 . main() { int a,b,c,d,t。 scanf(“%d %d %d %d”,amp。a,amp。b,amp。c,amp。d)。 if(ab) { t=a。a=b。b=t。} if(【 1】 ) {t=c。 c=d 。d=t。} if(ac ) {t=a。a=c。c=t。} if(【 2】 ) {t=b。b=c。c=t。} if(bd) {t=b。b=d。d=t。} if(cd) {t=c。c=d。d=t。} printf(“%d %d %d %d \n”,a,b,c,d)。 } (題 )以下程序的運行結(jié)果是 ——— . main() { int a=2,b=3,c。 c=1。 if(ab) c=1。 else if(a= =b) c=0。 else c= 1。 printf(“%d\n”,c)。 } (題 )若 a=1,b=2,則表達式 a b ? a : b + 1 的值是【 】 . (題 )若 a=1,b=2,c=3,d=4,則表達式 a b ? a : c d ? c : d 的值是【 】 . (題 )設有變量定義: int a=10, c=9;則表達式( a
點擊復制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1