摘要: Binary String Matching时间限制:3000ms | 内存限制:65535KB难度:3描述Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell ho... 阅读全文
posted @ 2014-03-28 19:54 zhoudan 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 括号配对问题时间限制:3000ms | 内存限制:65535KB难度:3描述现在,有一行括号序列,请你检查这行括号是否配对。输入第一行输入一个数N(0#include#includeusing namespace std;void main(){ char str[100],ch; int... 阅读全文
posted @ 2014-03-28 18:52 zhoudan 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 显示学生信息(学号、姓名、语文、数学),条件是:总成绩由高到低,当总成绩相同时,语文成绩高者优先。#include#include#includeusing namespace std;class Student{ int No; string name; int chinese; int mat... 阅读全文
posted @ 2014-03-28 15:56 zhoudan 阅读(320) 评论(0) 推荐(0) 编辑
摘要: priority_queue的模板参考定义 :template,class Pred=less>class priority_queue{//中间省略}int a[]={1,2,3,4,5,6,7,8,9,10};priority_queuepr(a,a+9); //通过构造函数将a[0]~a[... 阅读全文
posted @ 2014-03-28 10:12 zhoudan 阅读(216) 评论(0) 推荐(0) 编辑
摘要: #includestring s="do";s.size();s.insert(0,"How");s.append("you");s=s+"do?"s.size();归纳的知识点:(1) insert函数 :第一个参数表明插入源串的位置,第二个参数表明要插入的字符串,因此利用该函数可实现串首、串尾及... 阅读全文
posted @ 2014-03-28 09:44 zhoudan 阅读(93) 评论(0) 推荐(0) 编辑