摘要: Problem B: Throwing cards away IGiven is an ordered deck ofncards numbered 1 tonwith card 1 at the top and cardnat the bottom. The following operation... 阅读全文
posted @ 2015-06-12 23:42 Say舞步 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 水题,算出每次的结果,比较是否全0,循环1000次还不是全0则LOOPAC代码:#include #include #include #include #include #include #include #include #include #include #include #include #i... 阅读全文
posted @ 2015-06-12 23:16 Say舞步 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 直接用的格式输出,setw设置输出宽度,setiosflags(ios::left)进行左对齐。AC代码:#include #include #include #include #include #include #include #include #include #include #includ... 阅读全文
posted @ 2015-06-12 22:31 Say舞步 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 先计算出最长文件的长度M,然后计算列数和行数,最后输出即可。AC代码:#include #include #include #include #include #include #include #include #include #include #include #include #includ... 阅读全文
posted @ 2015-06-12 17:15 Say舞步 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 逐个生成丑数,对于任意丑数x,2x、3x、5x也都是丑数。AC代码#include #include #include #include #include #include #include #include #include #include #include #include #include ... 阅读全文
posted @ 2015-06-12 16:34 Say舞步 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 用两个队列,每个团队有一个队列,包含自己队伍中的人员编号,而团队整体形成一个队列,包含队列中的团队编号。AC代码:#include #include #include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2015-06-12 15:44 Say舞步 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 为每个不同的集合分配一个唯一的ID,每个集合表示成所包含元素的ID集合,这样集合就可以用STL的set来表示。栈是一个stack。AC代码:#include #include #include #include #include #include #include #include #include... 阅读全文
posted @ 2015-06-12 14:55 Say舞步 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Data in spreadsheets are stored in cells, which are organized in rows (r) and columns (c). Some operations on spreadsheets can be applied to single ce... 阅读全文
posted @ 2015-06-12 13:13 Say舞步 阅读(283) 评论(0) 推荐(0) 编辑
摘要: democlass Test{public: const void OpVar(int a, int b) { a = 100; }protected:private:};Test类中有一个成员函数OpVar,有一个const修饰符也可以写成下两种形式class Test{public: void... 阅读全文
posted @ 2015-06-12 00:04 Say舞步 阅读(281) 评论(0) 推荐(0) 编辑