摘要: 重定向 redirection 每个命令有输入源和输出目的地,默认行为,是标准输入和标准输出。大多数情况,标准输入是键盘,标准输出是屏幕。可以为单独的操作修改输入和输出,这就是重定向。重定向可以使某个命令从源文件输入而不是键盘,或输出到显示器以外的地方(比如存储到文件)。 使用来定义输入和输出源。使用>>追加到文件的末尾。 sortterms-alpha这个命令将terms文件中的条目排... 阅读全文
posted @ 2016-12-03 13:38 marcusxu 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 问题描述 Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find... 阅读全文
posted @ 2016-12-03 09:38 marcusxu 阅读(169) 评论(0) 推荐(0) 编辑
摘要: STL的pair,有两个值,可以是不同的类型。 template struct pair; 注意,pair在头文件utility中,不要include。(一个错误是 include ) 成员类型 first_type first的类型 second_type second的类型 成员变量 first 第一个值 second 第二个值 成员函数 构造函数 p... 阅读全文
posted @ 2016-12-03 08:56 marcusxu 阅读(264) 评论(0) 推荐(0) 编辑