上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: print.h//print.h#include <iostream>using namespace std;#ifndef print_fun#define print_funtemplate<typename T>///显示序列数据void print(T b,T e,char c=' '){ bool isExit=false; while (b!=e) { cout<<*b++<<c; isExit=true; } if(isExit) cout<<endl;}template<typename K,ty 阅读全文
posted @ 2012-10-26 08:10 真爱无限 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 弹出固定大小窗口<SCRIPT language=javascript> function openScript(url, width, height) { var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=n0' );}</SCRIPT><body> <a href='jav 阅读全文
posted @ 2012-10-25 19:11 真爱无限 阅读(627) 评论(0) 推荐(0) 编辑
摘要: http://www.nunit.org/index.php?p=download上面地址下载,有安装版的,有直接解压版的,只有里面的nunit.framewor.dll就可以做简单的测试了。安装版的路径默认为:C:\Program Files \NUnit 2.6\bin\framework\nunit.framewor.dll从vs2010中直接下载安装插件:安装完后提示重启vs,然后就可以打开用了,在视图中可以打开:然后写好测试代码之后,就能够看到结果,不对的话会有相应的错误。。其它的不说那么多了。。示例源码:http://download.csdn.net/detail/pukuimi 阅读全文
posted @ 2012-10-25 17:27 真爱无限 阅读(192) 评论(0) 推荐(0) 编辑
摘要: /*multimap特性key可以重复不支持下标访问*/#include<iostream>#include<string>#include "print.h"#include<map>using namespace std;typedef pair<int,string> pairmp;typedef multimap<string,double> MS;int main(){ MS m; m.insert(MS::value_type("t1",1000)); m.insert(MS::va 阅读全文
posted @ 2012-10-25 15:47 真爱无限 阅读(274) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;using System.Diagnostics;using System.Collections;namespace ICompare测试{ class Program { static void Main(string[] args) { Process[] allprocess = Process.GetProcesses();//所有运行的进程 SortByProcessNam... 阅读全文
posted @ 2012-10-16 09:26 真爱无限 阅读(331) 评论(0) 推荐(0) 编辑
摘要: //vector.cpp/*vector的特性当前容量:.capacity()约定容量:.reserve()下标:.operator[](i) ,.at(i) 越界抛出异常*/#include<iostream>using namespace std;#include<vector>#include<exception>#include<typeinfo>#include "print.h"void print(const vector< vector<int> >& v)//相当于二维数组{ 阅读全文
posted @ 2012-10-15 20:50 真爱无限 阅读(712) 评论(0) 推荐(0) 编辑
摘要: /*迭代器.begin(),.end() ,.rbegin() , .rend()插入:.insert(position,element)删除:.erase(position),.erase(pos_begin,pos_end)清除:.clear()大小:.size(), .max_size(), .empty()交换:.swap(c2) , swap(c1,c2)运算符:=,>,<,>=,<=,==,!=*/#include <iostream>using namespace std;#include <vector>#include < 阅读全文
posted @ 2012-10-15 11:20 真爱无限 阅读(237) 评论(0) 推荐(0) 编辑
摘要: //使用库函数排序举例#include <iostream>#include <string>#include <algorithm>//内有排序库函数using namespace std;#ifndef person_h_1 //预定义指令#define person_h_1class person{public: person(const char* name,int age):name(name),age(age){}//构造函数 friend ostream& operator<<(ostream& o,const pe 阅读全文
posted @ 2012-10-14 21:53 真爱无限 阅读(196) 评论(0) 推荐(0) 编辑
摘要: //函数模版使用//函数模版标准不支持参数默认值#include<iostream>#include<cstring>using namespace std;template <typename T>void sort(T* a,int n)//普通冒泡排序{ bool changed; do { changed=false; for(int i=1;i<n;i++) { if(a[i]<a[i-1]) { swap(a[i],a[i-1]); changed=true; } } --n; } while(changed);}template & 阅读全文
posted @ 2012-10-13 11:48 真爱无限 阅读(230) 评论(0) 推荐(0) 编辑
摘要: //栈中使用类模版例子#include <iostream>#include <typeinfo>using namespace std;//typedef char T;template<typename T,int len=4>//可以有默认值,有默认值的参数靠右//如果成员函数在类外写,那么每个函数前要加语句: template<typename T> class Stack{ T a[len]; int cur;public: Stack():cur(0){} const char* stype()const//类型 { return t 阅读全文
posted @ 2012-10-12 10:51 真爱无限 阅读(234) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 10 下一页