首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

Linux文件基础I/O

1.空文件也要在磁盘占据空间 2.文件 = 内容 + 属性 3.文件操作 = 对内容 + 对属性 4.标定一个文件,必须使用文件路径 + 文件名(唯一性) 5.如果没有指明对应的文件路径,默认是在当前路径进行访问 6.当我们把fopen,fclose,fread,fwrite等接口写完之后,代码编译之后,形成二进制可执行程序之后,但是没运行,文件对应的操作有没有被执行呢?没有 —— 对文件操作的本质是进程对文件的操作。 7.一个文件如果没被打开,可以直接进行文件访问吗??不能!一个文件要被访问,就必须先被打开!(被打开的时候是用户调用端口,操作系统负责操控硬件,所以这个操作是用户进程和操作系统共同完成的) 8.磁盘的文件不是所有的都被打开,是一部分被打开,一部分关闭。 总结:文件操作的本质是进程和被打开文件之间的关系。

00

Supermarket超市(贪心算法 优先队列)- POJ 1456

A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the sale begins. Each product takes precisely one unit of time for being sold. A selling schedule is an ordered subset of products Sell ≤ Prod such that the selling of each product x∈Sell, according to the ordering of Sell, completes before the deadline dx or just when dx expires. The profit of the selling schedule is Profit(Sell)=Σx∈Sellpx. An optimal selling schedule is a schedule with a maximum profit. For example, consider the products Prod={a,b,c,d} with (pa,da)=(50,2), (pb,db)=(10,1), (pc,dc)=(20,2), and (pd,dd)=(30,1). The possible selling schedules are listed in table 1. For instance, the schedule Sell={d,a} shows that the selling of product d starts at time 0 and ends at time 1, while the selling of product a starts at time 1 and ends at time 2. Each of these products is sold by its deadline. Sell is the optimal schedule and its profit is 80.

02
领券