程序存储问题:设有n 个程序{1,2,…, n }要存放在长度为L的磁带上。程序i存放在磁带上的长度是Li ,1≤i≤n 程序存储问题要求确定这n 个程序在磁带...
代码说明:
程序存储问题:设有n 个程序{1,2,…, n }要存放在长度为L的磁带上。程序i存放在磁带上的长度是Li ,1≤i≤n 程序存储问题要求确定这n 个程序在磁带上的一个存储方案,使得能够在磁带上存储尽可能多的程序。 编程任务: 对于给定的n个程序存放在磁带上的长度,编程计算磁带上最多可以存储的程序数。 数据输入:由文件input.txt给出输入数据。第一行是正整数n,表示文件个数。接下来的1 行中,有n 个正整数,表示程序存放在磁带上的长度。 结果输出: input.txt output.txt 6 50 5 2 3 13 8 80 20 -program storage problem : There n procedures (1,2, ..., n) to be stored in the length of the L tape. I kept in the proceedings on the tape length is Li, 1 i n storage procedures to seek to establish that n procedures on tape storage of a program that allows the tape to store as much as possible the procedure. Programming tasks : to the n procedures stored in the tape length, calculated programming on tape can store up to the number of procedures. Data input : from the document input.txt given input data. The first line is a positive integer n, said the document number. Following a visit, n is an integer, said procedures stored on tape length. Results output : input.txt output.txt 6 50 5 2 3 13 8 80 20
下载说明:请别用迅雷下载,失败请重下,重下不扣分!