#44226: 英文解釋、提示


yp11351225@yphs.tp.edu.tw (710-42葛雨樂)

學校 : 臺北市私立延平高級中學
編號 : 276265
來源 : [203.72.178.1]
最後登入時間 :
2024-12-05 17:13:30
d899. NOIP2010 1.数字统计 -- NOIP2010普及组第一题 | From: [203.72.178.1] | 發表日期 : 2024-11-14 17:54

Question number: d889 
Question name: Statistics of numbers
Question description: Please calculate the total appearances of the digits in an assigned value
range [L,R].  We ensure that the values will be in the term of 0<L<R<10000.
Example: As in the specified range [2,22] (L=2; R=22) the digit 2 appeared once in the number 2,
once in the number 12, once in the number 20, once in the number 21, and twice in the number 22. 
That gives a total of 6 appearances of the digit 2.

提示:

  1. 使用for迴圈。
  2. 使用餘數算法:當除以10餘數為2,再除以10,不是餘2結束迴圈 。

 

 
ZeroJudge Forum