網頁

2011年4月14日 星期四

mod 3=0 or mod 7=0

計算所有小於100的整數中能被3整除, 或被7整除之和

switch-case

請用switch-case, 輸入int格式x,
x=1 輸出字串"星期一"
x=2 輸出字串"星期二"
x=3 輸出字串"星期三"
x=4 輸出字串"星期四"
x=5 輸出字串"星期五"
x=6 輸出字串"星期六"
x=7 輸出字串"星期日"

猜數字


請你完成上圖所示之猜數字程式, (要用do-while), 猜到對為止, 答案可自設或用亂數取