文件名称:1
-
所属分类:
- 标签属性:
- 上传时间:2013-03-28
-
文件大小:1.08kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
问题描述:
一本书的页码从自然数1 开始顺序编码直到自然数n。书的页码按照通常的习惯编排,每个页码都不含多余的前导数字0。例如,第6 页用数字6 表示,而不是06 或006 等。数字计数问题要求对给定书的总页码n,计算出书的全部页码中分别用到多少次数字0,1,2,…,9。
编程任务:
给定表示书的总页码的10 进制整数n (1≤n≤109) 。编程计算书的全部页码中分别用到多少次数字0,1,2,…,9。
数据输入:
输入数据由文件名为input.txt的文本文件提供。
每个文件只有1 行,给出表示书的总页码的整数n。
结果输出:
程序运行结束时,将计算结果输出到文件output.txt中。输出文件共有10行,在第k行输出页码中用到数字k-1 的次数,k=1,2,…,10。
-The descr iption of the problem: the page of a book from the natural numbers sequentially coding until the natural number n. The page number of the book in accordance with the usual custom layout each page does not contain a the excess leading digital 0. For example, the first six with a digital 6 shows, rather than 06 or 006. The digital counting problem requires calculated the total page number n of a given book, full folio books were used how many times the numbers 0, 1, 2, ..., 9. Programming task: given to represent the total pages in the book decimal integer n (1 ≤ n ≤ 109). Full Page programming calculations were used how many times the numbers 0, 1, 2, ..., 9. Data input: input data from a text file called input.txt file. Each file is only one line given the said book page number integer n. The result output: the end of the program runs, the calculation results output to the file output.txt. The output file 10 lines in total, are used in the k-th row output page number of times
一本书的页码从自然数1 开始顺序编码直到自然数n。书的页码按照通常的习惯编排,每个页码都不含多余的前导数字0。例如,第6 页用数字6 表示,而不是06 或006 等。数字计数问题要求对给定书的总页码n,计算出书的全部页码中分别用到多少次数字0,1,2,…,9。
编程任务:
给定表示书的总页码的10 进制整数n (1≤n≤109) 。编程计算书的全部页码中分别用到多少次数字0,1,2,…,9。
数据输入:
输入数据由文件名为input.txt的文本文件提供。
每个文件只有1 行,给出表示书的总页码的整数n。
结果输出:
程序运行结束时,将计算结果输出到文件output.txt中。输出文件共有10行,在第k行输出页码中用到数字k-1 的次数,k=1,2,…,10。
-The descr iption of the problem: the page of a book from the natural numbers sequentially coding until the natural number n. The page number of the book in accordance with the usual custom layout each page does not contain a the excess leading digital 0. For example, the first six with a digital 6 shows, rather than 06 or 006. The digital counting problem requires calculated the total page number n of a given book, full folio books were used how many times the numbers 0, 1, 2, ..., 9. Programming task: given to represent the total pages in the book decimal integer n (1 ≤ n ≤ 109). Full Page programming calculations were used how many times the numbers 0, 1, 2, ..., 9. Data input: input data from a text file called input.txt file. Each file is only one line given the said book page number integer n. The result output: the end of the program runs, the calculation results output to the file output.txt. The output file 10 lines in total, are used in the k-th row output page number of times
(系统自动生成,下载前可以参看下载内容)
下载文件列表
1.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.