【正文】
p。b=num2。 a=b。 } printf(gongyueshu:%d\n,a)。 getch()。:利用while語句,條件為輸入的字符不為39。. ?。篿nclude include main(){ char c。 printf(please input some characters\n)。\n39。a39。amp。z39。A39。amp。Z39。 else if(c==39。) space++。039。amp。939。 else others++。 getch()。例如2+22+222+2222+22222(此時 共有5個數(shù)相加),幾個數(shù)相加有鍵盤控制。:include include main(){ int a,n,count=1。 printf(please input a and n\n)。a,amp。 printf(a=%d,n=%d\n,a,n)。 sn=sn+tn。 ++count。 getch()。例如6=1+2+ 找出1000以內(nèi)的所有完數(shù)。 int i,j,n,s。j1000。 s=j。ij。 s=si。 } } if(s==0) { printf(%d is a wanshu,j)。in。 printf(%d\n,k[n])。}============================================================== 【程序20】題目:一球從100米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在 第10次落地時,共經(jīng)過多少米?第10次反彈多高?:見下面注釋:include include main(){ float sn=,hn=sn/2。 for(n=2。n++) { sn=sn+2*hn。 /*第n次反跳高度*/ } printf(the total of road is %f\n,sn)。 get