#练习8.4:编写函数,以读模式打开一个文件,将其内容读入到一个string的vector种,将每一行作为一个独立的元素存于vector中.#include<iostream>
#include<fstream>
#include<string>
#include<vector>
intmain(intargc,char**argv)
{
std::ifstreaminpu..
分类:
编程语言 时间:
2014-11-22 02:10:04
阅读次数:
387
队列在书中说明的方式是两种,一种最简单的链表队列,判断情况比较简单,另一种是使用数组进行创建,限制较多,但是速度较快,也比较容易控制内存,不至于出现在链表实现上那么复杂的内存控制。下面先是链表实现:ListQueue.cpp 1 #include "iostream" 2 #include "std...
分类:
其他好文 时间:
2014-11-22 00:43:50
阅读次数:
148
The Suspects
Time Limit: 1000MS
Memory Limit: 20000K
Total Submissions: 23337
Accepted: 11345
Description
Severe acute respiratory syndrome (SARS), an atypical pneu...
分类:
其他好文 时间:
2014-11-21 10:48:05
阅读次数:
251
栈是一种先进后出或说是后进先出的数据结构,书中介绍了两种简单实现方法,其中使用链表的是比较方便的方式,而是用数组的方式效率比较高,但是需要初始化的时候指明最大数组元素上限个数。下面是简单实现:1.链表方式ListStack.cpp 1 /*栈的数组实现*/ 2 #include "iostream"...
分类:
其他好文 时间:
2014-11-20 01:20:38
阅读次数:
293
这是一个求一个排序的下一个排列的函数,可以遍历全排列,要包含头文件
下面是以前的笔记 与之完全相反的函数还有prev_permutation
(1) int 类型的next_permutation
int main()
{
int a[3];
a[0]=1;a[1]=2;a[2]=3;
do
{
cout
} while (next_permutat...
分类:
其他好文 时间:
2014-11-19 22:25:43
阅读次数:
322
8592 KMP算法
时间限制:1000MS 内存限制:1000K
题型: 编程题 语言: 无限制
描述
用KMP算法对主串和模式串进行模式匹配。本题目给出部分代码,请补全内容。
#include "stdio.h"
#include "stdlib.h"
#include "iostream.h"
#define TRUE...
分类:
编程语言 时间:
2014-11-19 22:19:25
阅读次数:
384
1229: Rational Resistance
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 8 Solved: 4
[Submit][Status][Web
Board]
Description
Mad scientist Mike is building a time machine in his spare t...
分类:
其他好文 时间:
2014-11-19 11:27:08
阅读次数:
305
1228: Simple Molecules
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 22 Solved: 8
[Submit][Status][Web
Board]
Description
Mad scientist Mike is busy carrying out experiments in chemist...
分类:
其他好文 时间:
2014-11-19 11:24:12
阅读次数:
235
1230: Magnets
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 24 Solved: 13
[Submit][Status][Web
Board]
Description
Mad scientist Mike entertains himself by arranging rows of dominoes. H...
分类:
其他好文 时间:
2014-11-19 11:23:56
阅读次数:
135
Problem E: Fixed Points
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 29 Solved: 11
[Submit][Status][Web
Board]
Description
A permutation of length n is an integer sequence such that e...
分类:
其他好文 时间:
2014-11-19 11:22:14
阅读次数:
231