[問題] 2010年的worksheet 2.3

作者: kazewind22   2012-10-11 00:27:59
Write a program to compute a score for a integer number.
If the input is zero or negative the score is -100.
Otherwise we start with 0. If the number is a multiple of 3,
add 3 to the score. If the number is a multiple of 5,
add 5 to the score. If the number is between 100 and 200 (inclusive),
add 50 to the score, else subtract 50 from the score. Now print the score.
我無法理解題意
一直寫不過QQ
作者: jeremy89183 (蔗的平方)   0000-00-00 00:00:00
輸入N N<=0 score=-100否則 若是N=3k score+3 N=5k score+5N在[100,200] score+50 若以上皆非 score-50這樣吧?
作者: kazewind22   0000-00-00 00:00:00
所以else subtract 50 意思是上面三個條件都錯?
作者: jeremy89183 (蔗的平方)   0000-00-00 00:00:00
看起來是不在[100,200] (?)
作者: kazewind22   0000-00-00 00:00:00
解決了 謝囉

Links booklink

Contact Us: admin [ a t ] ucptt.com