[问题] 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