文件名称:4
介绍说明--下载内容均来自于网络,请自行研究使用
已知在文件IN.DAT中存有100个产品销售记录,每个产品销售记录由产品代码dm(字符型4位),产品名称mc(字符型10位),单价dj(整型),数量sl(整型),金额je(长整型)五部分组成。其中:金额=单价*数量计算得出。函数ReadDat()是读取这100个销售记录并存入结构数组sell中。请编制函数SortDat(),其功能要求:
按产品名称从小到大进行排列,若产品名称相等,则按金额从小到大进行排列,最终排列结果仍存入结构数组sell中,最后调用函数WriteDat()把结果输出到文件OUT5.DAT中。
-Known to exist in the document IN.DAT in 100 sales records, sales records for each product by the product code dm (character 4), the product name mc (character 10), unit dj (integer), the number of sl (integer), the amount of je (long integer) of five parts. Where: Amount = Price* Quantity is calculated. Function ReadDat () is to read the 100 sales recorded and credited to sell in the array structure. Prepare function SortDat (), its functional requirements: from small to large by product name arranged, if the product name equivalent, according to the amount of small to large to be ranked, ordered the end result still sell an array of deposit structure, the last call to function WriteDat ( ) to the output to a file OUT5.DAT in.
按产品名称从小到大进行排列,若产品名称相等,则按金额从小到大进行排列,最终排列结果仍存入结构数组sell中,最后调用函数WriteDat()把结果输出到文件OUT5.DAT中。
-Known to exist in the document IN.DAT in 100 sales records, sales records for each product by the product code dm (character 4), the product name mc (character 10), unit dj (integer), the number of sl (integer), the amount of je (long integer) of five parts. Where: Amount = Price* Quantity is calculated. Function ReadDat () is to read the 100 sales recorded and credited to sell in the array structure. Prepare function SortDat (), its functional requirements: from small to large by product name arranged, if the product name equivalent, according to the amount of small to large to be ranked, ordered the end result still sell an array of deposit structure, the last call to function WriteDat ( ) to the output to a file OUT5.DAT in.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
4.c