摘要: #ifndef __MyConsole__Stack__#define __MyConsole__Stack__#include templateclass Stack{public: explicit Stack(int size); ~Stack(); bool IsEmpty(); int CurrentSize(); bool Push(const T& item); bool IsFull(); void ShowStack(); bool Pop(T *pResult);private: int top; int maxSize; T *data; };us... 阅读全文
posted @ 2014-02-25 15:46 Predator 阅读(446) 评论(0) 推荐(0) 编辑
摘要: void BubbleSort(int datas[], int len){ int tem; bool isSorted = false; for (int i = len - 1; isSorted == false && i >= 1; --i) { isSorted = true; for (int j = 0; j datas[j + 1]) { isSorted = false; tem = datas[j]; datas[j] = datas[j + 1]; datas[j + 1] = tem; ... 阅读全文
posted @ 2014-02-25 15:45 Predator 阅读(120) 评论(0) 推荐(0) 编辑
摘要: void SelectSort(int datas[], int len){ int tem; for (int i = 0; i datas[j]) { tem = datas[i]; datas[i] = datas[j]; datas[j] = tem; } } } for (int k = 0; k < len; ++k) { std::cout << datas[k] << " " ; } cout << endl;} 阅读全文
posted @ 2014-02-25 15:45 Predator 阅读(99) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std;void main(){HANDLE h =CreateMutex(NULL, FALSE, TEXT("133"));if(GetLastError() == ERROR_ALREADY_EXISTS){return;}char szInput[256];char szCreate[256];char ch;cin >> szInput;ifstream input(szInput, ios::in);if (input.fail()){ cout 阅读全文
posted @ 2013-10-03 22:01 Predator 阅读(270) 评论(0) 推荐(0) 编辑