文件名称:1
下载
别用迅雷、360浏览器下载。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
介绍说明--下载内容均来自于网络,请自行研究使用
问题描述:给定一个自然数n,由n开始可以依次产生半数集set(n)中的数如下:
(1) n∈set(n)
(2)在n的左边加上一个自然数,但该自然数不能超过最近添加的数的一半;
(3)按此规则进行处理,直到不能再添加自然数为止。
★算法设计:对于给定的自然数n,技术半数集set(n)中的元素个数。
★输入的数据由文件名为input.txt的文本文件提供。每个文件只有一行,给出整数n(0<n<1000)。
★结果输出: 将计算结果输出到文件output.txt。输出文件只有一行,给出半数集set(n)中的元素个数。
-Problem descr iption: Given a natural number N by n started can be sequentially generated half set SET (n) is the number is as follows: (1) N ∈ SET (N) (2) on the left side of the n plus a natural number, but the natural number can not exceed half the number of the most recently added (3) of this rule for processing, until it can not add a natural number. ★ algorithm design technology half sets the number of elements in the set (n): For a given natural number n. ★ input data from a text file called input.txt file. Only one line for each file given integer n (0 <n<1000)。
★结果输出: 将计算结果输出到文件output.txt。输出文件只有一行,给出半数集set(n)中的元素个数。
(1) n∈set(n)
(2)在n的左边加上一个自然数,但该自然数不能超过最近添加的数的一半;
(3)按此规则进行处理,直到不能再添加自然数为止。
★算法设计:对于给定的自然数n,技术半数集set(n)中的元素个数。
★输入的数据由文件名为input.txt的文本文件提供。每个文件只有一行,给出整数n(0<n<1000)。
★结果输出: 将计算结果输出到文件output.txt。输出文件只有一行,给出半数集set(n)中的元素个数。
-Problem descr iption: Given a natural number N by n started can be sequentially generated half set SET (n) is the number is as follows: (1) N ∈ SET (N) (2) on the left side of the n plus a natural number, but the natural number can not exceed half the number of the most recently added (3) of this rule for processing, until it can not add a natural number. ★ algorithm design technology half sets the number of elements in the set (n): For a given natural number n. ★ input data from a text file called input.txt file. Only one line for each file given integer n (0 <n<1000)。
★结果输出: 将计算结果输出到文件output.txt。输出文件只有一行,给出半数集set(n)中的元素个数。
(系统自动生成,下载前可以参看下载内容)
下载文件列表
2-3.cpp
测试数据.rar