Time of Update: 2018-12-03
轉自:http://zhedahht.blog.163.com/blog/static/2541117420116135376632/ 問題描述:在數組中,數字減去它右邊的數字得到一個數對之差。求所有數對之差的最大值。例如在數組{2, 4, 1, 16, 7, 5, 11,
Time of Update: 2018-12-03
//約瑟夫環問題#include <iostream>#include <list>using namespace std;int bxy1(unsigned int n,unsigned int m){if(n<1 || m<1){return -1;}//初始化約瑟夫環list<int> integers;for(unsigned int i = 0; i < n; ++i){integers.push_back(i);}list<
Time of Update: 2018-12-03
//測試程式,輸入一些數字,插入到一個向量中,如果重複輸入則丟棄,最後保證向量中的數字是不重複的#include <iostream>#include <vector>#include <algorithm>#include <fstream>using namespace std;void main(){vector<int> v;int x;fstream
Time of Update: 2018-12-03
//在二叉樹中找出和為某一值的所有路徑#include <iostream>#include <vector>using namespace std;//樹結構struct BTreeNode{int m_nValue;BTreeNode *m_pLeft;BTreeNode *m_pRight;}*BiTree;//按照先序建立二叉樹,0表示空BTreeNode *Create(){ int ch; cin>> ch; if(ch == 0
Time of Update: 2018-12-03
//題目:手動輸入n行文本,找出給定字串最後出現在哪一行?//拓展習題//找出一篇文章中,關鍵詞,所出現的行以及行號#include <stdio.h>#include <string.h>void readline(const char *SubStr,char *line,int &Hang_Shu){char temp_str[80];int
Time of Update: 2018-12-03
最近在做簡訊開發的事情,看到這篇文章,感覺不錯,給大家共用一下。就"通過串口收發短訊息"專題,本人將同網友交流、探討的部分技術問題整理成如下文字。希望這篇文章能對更多對SMS感興趣的朋友有所協助。由於本人是業餘愛好,時間和金錢都有限,沒有力量將很多型號的手機和模組一一實驗,可能存在這樣那樣的差錯,希望行內高人批評指正。Q 我寫了個簡訊發送程式,使用PDU格式發送,程式在廣州使用一點問題也沒有,在河南卻怎麼也發不出去。不知道為什麼,簡訊"你好嗎"格式如下: 河南: 0891683108200005
Time of Update: 2018-12-03
#define _AFXDLL #include <afxwin.h>#include <iostream>#include <vector>#include <string>using namespace std;int _Finder(LPCTSTR pstr){CFileFind finder ;vector<CString> svec;CString strWildcard(pstr) ;strWildcard += _T("\
Time of Update: 2018-12-03
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>//在s1中尋找s2,並返回s2在s1中第一次出現的位置char *strstr_bxy(const char *s1,const char *s2){assert(s1 != NULL && s2 != NULL);if(*s2 != '\0'){while(*s1 != '\0')
Time of Update: 2018-12-03
template<typename T>class Array{private:T *data;unsigned int size;public ://帶參數的建構函式Array(unsigned int arraySize):data(0),size(arraySize){if(size > 0){data = new T[size];}}//解構函式~Array(){if(data != NULL){delete[] data;}}//設定下標為index的值void
Time of Update: 2018-12-03
定義棧的資料結構,要求添加一個min 函數,能夠得到棧的最小元素。要求函數min、push 以及pop 的時間複雜度都是O(1)。#include <deque>#include <assert.h>#include <iostream>using namespace std;template<typename T>class MyStack{private:deque<T> m_data;deque<size_t>
Time of Update: 2018-12-03
今天看到一篇老外的文章,覺得寫得不錯,分享一下:原文地址串連:http://www.codeproject.com/KB/HTML/SpeedUpWebsite.aspx 總結以下幾點:1、減少圖片和css,js等2、盡量壓縮傳輸3、使用用戶端瀏覽器緩衝,可以設定如下:<html> <head> <title>Cache - Example</title> <meta http-equiv="Expires" content="
Time of Update: 2018-12-03
#include <iostream>using namespace std;//總結今天的面試題,就是看一個正整數是不是迴文數//方法1,將數字翻轉,如果和原來的數字相同,則是迴文數bool HuiWen(int num){if(num < 0){return 0;}int origin = num;int n = 0;while(num > 0){n = n*10 + num%10;num = num / 10;}return (n == origin);}//方法2
Time of Update: 2018-12-03
最近收到不少網友關於在物件導向的分析設計中如何進行資料庫設計的疑問。在大象-thinking in uml一書裡,我詳細講述了物件導向從需求到設計的整個過程,但確實對資料庫設計著墨甚少。因此寫這篇文章對這個問題詳細說明,在第二版裡應當也會加上這一部分。 先貼出一位網友的疑問以及我的回複,作為這篇文章的引子: 網友fdshxp問道: 在軟體開發時要進行資料庫設計,現在通常的做法是需求分析, 做資料流圖,畫ER圖,這些顯然是面向過程的東西,
Time of Update: 2018-12-03
#include <iostream>#include <fstream>#include <set>using namespace std;//求二個集合A、B交集的補集,類似於異或操作void f(const set<int> &A,const set<int> &B,set<int> &C){C =
Time of Update: 2018-12-03
#include <stdio.h>#include <assert.h>int atoi(const char *str){int signal=1;int result=0;assert(str != NULL);if((*str>='0'&& *str<='9') || *str=='-' || *str=='+'){if(*str=='-' ||
Time of Update: 2018-12-03
#include <iostream>using namespace std;bool FindGreatestSumOfArray(int *pData,unsigned int nLength,int &nGreatestSum){if(pData == NULL || nLength <= 0){return false;}int nCurSum = nGreatestSum = 0;for(unsigned int i=0; i<nLength; ++i)
Time of Update: 2018-12-03
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>void main(){char text[1000];int maxValue=0;int value=0;printf("請輸入一行文本:\n");gets(text);int length=strlen(text);for(int
Time of Update: 2018-12-03
檢索 COM 類別工廠中 CLSID 為 {000209FF-0000-0000-C000-000000000046} 的組件時失敗解決方案 檢索 COM 類別工廠中 CLSID 為 {000209FF-0000-0000-C000-000000000046} 的組件時失敗,原因是出現以下錯誤: 80070005 在CSDN上總是有網友問這個問題,自己也遇到過,因些寫出來供參考:癥狀:oWordApplic = New Word.Application當程式運行到這句時出現下面的錯誤:檢索
Time of Update: 2018-12-03
倉儲配送管理系統 東方虹配送管理系統是以現代物流管理理論為指導,採用先進的網路技術、電腦技術、通訊技術、資料庫技術,以解決中心資料交換、無紙化作業、多模式管理、自動化計費等關鍵問題為重點,建立一個具有世界先進水平、行業一流的現代配送管理系統,為物流企業提供科學的管理手段和現代化的管理工具,以提高企業的現代化管理水平,實現超大規模發展,並在發展中能夠有效地管理、控制,達到增強企業競爭力和全面提高企業經濟效益的目的。
Time of Update: 2018-12-03
#include <stdio.h>#include <iostream>using namespace std;struct BSTreeNode{ int m_nValue; // value of node BSTreeNode *m_pLeft; // left child of node BSTreeNode *m_pRight; // right child of node};typedef BSTreeNode