原创 PAT (Basic Level) Practise (中文)—— 1007. 素數對猜想

http://pat.zju.edu.cn/contests/pat-b-practise/1007 讓我們定義 dn 爲:dn = pn+1 - pn,其中 pi 是第i個素數。顯然有 d1=1 且對於n>1有 dn 是偶數。“素數

原创 PAT (Basic Level) Practise (中文)—— 1009. 說反話

http://pat.zju.edu.cn/contests/pat-b-practise/1009 給定一句英語,要求你編寫程序,將句中所有單詞的順序顛倒輸出。 輸入格式:測試輸入包含一個測試用例,在一行內給出總長度不超過80的字符串

原创 PAT (Advanced Level) Practise —— 1002. A+B for Polynomials

http://pat.zju.edu.cn/contests/pat-a-practise/1002 This time, you are supposed to find A+B where A and B are two polyn

原创 利用.bat文件打開U盤根目錄下指定文件夾的程序

http://zhidao.baidu.com/question/26221629.html 打開記事本,編輯如下內容 (假設U盤的根目錄有[工具]文件夾,而需要建的快捷方式就指向它裏面的內容):    Start "" "工具\系統工

原创 PAT (Basic Level) Practise (中文)—— 1005. 繼續(3n+1)猜想

http://pat.zju.edu.cn/contests/pat-b-practise/1005 卡拉茲(Callatz)猜想已經在1001中給出了描述。在這個題目裏,情況稍微有些複雜。 當我們驗證卡拉茲猜想的時候,爲了避免重複計算

原创 PAT (Basic Level) Practise (中文)—— 1008. 數組元素循環右移問題

http://pat.zju.edu.cn/contests/pat-b-practise/1008 一個數組A中存有N(N>0)個整數,在不允許使用另外數組的前提下,將每個整數循環向右移M(M>=0)個位置,即將A中的數據由(A0

原创 PAT (Advanced Level) Practise —— 1001. A+B Format (20)

http://pat.zju.edu.cn/contests/pat-a-practise/1001 Calculate a + b and output the sum in standard format -- that is,

原创 PAT (Basic Level) Practise (中文)—— 1010. 一元多項式求導

http://pat.zju.edu.cn/contests/pat-b-practise 設計函數求一元多項式的導數。 輸入格式:以指數遞降方式輸入多項式非零項係數和指數(絕對值均爲不超過1000的整數)。數字間以空格分隔。 輸出格

原创 圖像處理:均值濾波

濾波 濾波是將信號中特定波段頻率濾除的操作,是從含有干擾的接收信號中提取有用信號的一種技術。 均值濾波 均值濾波是典型的線性濾波算法,它是指在圖像上對目標像素給一個模板,該模板包括了其周圍的臨近像素(如3×3模板:以目標象素爲中心的周圍

原创 PAT (Basic Level) Practise (中文) —— 1006. 換個格式輸出整數

http://pat.zju.edu.cn/contests/pat-b-practise/1006 讓我們用字母B來表示“百”、字母S表示“十”,用“12...n”來表示個位數字n(<10),換個格式來輸出任一個不超過3位的正整數。例

原创 MFC中CFrameWnd::GetActiveView函數的使用

被一個小bug卡了很長時間,走了很多彎路。應該先查MSDN的。我的錯誤在於不知道“在MDI應用程序中,MDI主框架窗口沒有一個關聯的視圖。 相反,每個單獨的子窗口(CMDIChildWnd)具有一個或多個關聯的視圖。” 見http://t

原创 柴郡貓技術--C++中的PIMPL設計模式

另一個 Blog 地址:http://insaneguy.me 原文鏈接:http://insaneguy.me/2015/04/05/cheshire_cat_in_cpp-pimpl_idiom/ C++ 中的“柴郡貓技術”(Ch

原创 UVa OJ 10035 Primary Arithmetic

UVa OJ 10035  Problem B: Primary Arithmetic Children are taught to add multi-digit numbers from right-to-left one di

原创 UVa OJ 623 階乘

UVa OJ 623  500! In these days you can more and more often happen to see programs which perform some useful calcul

原创 UVa OJ 642 Word Amalgamation

  Word Amalgamation  In millions of newspapers across the United States there is a word game called Jumble. The ob