計算機算法中著名的0_1背包問題:給定n種物品和一背包。物品i的重量是Wi,其價值為Vi,背包的容量是c,問應如何選擇裝入背包中的物品,使得裝入背包中物品的總價值最大。
上傳時間: 2015-06-20
上傳用戶:leehom61
剖析Intel IA32 架構下C 語言及CPU 浮點數機制 Version 0.01 哈爾濱工業大學 謝煜波 (email: xieyubo@126.com 網址:http://purec.binghua.com) (QQ:13916830 哈工大紫丁香BBSID:iamxiaohan) 前言 這兩天翻看一本C 語言書的時候,發現上面有一段這樣寫到 例:將同一實型數分別賦值給單精度實型和雙精度實型,然后打印輸出。 #include <stdio.h> main() { float a double b a = 123456.789e4 b = 123456.789e4 printf(“%f\n%f\n”,a,b) } 運行結果如下:
標簽: Version xieyubo Intel email
上傳時間: 2013-12-25
上傳用戶:徐孺
矩陣運算的算法 用Type類數組創建矩陣對象 matrix(int rows,int cols) //創建矩陣,值為0 matrix(int n) //創建單位陣 matrix(const matrix &) //拷貝構造函數 BOOL Ismatrixf(){ return (rows==cols) } //判斷矩陣是否為方陣 modifyrowscols(int rows,int cols) //修改矩陣的行列數 ~matrix() {delete []elems } //析構函數
上傳時間: 2015-07-14
上傳用戶:水口鴻勝電器
本文根據發表在CUJ Expert Forum上的兩篇文章編譯而成。C/C++ User s Journal是目前最出色的C/C++語言專業雜志,特別是在C++ Report閉刊之后,CUJ的地位更加突出。CUJ Expert Forum是CUJ主辦的網上技術專欄,匯集2000年10月以來C++社群中頂尖專家的技術短文,并免費公開發布,精彩紛呈,是每一個C/C++學習者不可錯過的資料。由Jim Hyslop和Herb Sutter主持的Conversation系列,是CUJ Expert Forum每期必備的精品專欄,以風趣幽默的對話形式講解C++高級技術,在C++社群內得到廣泛贊譽。譯者特別挑選兩篇設計模式方面的文章,介紹給大家。設計模式方面的經典著作是GoF的Design Patterns。但是那本書有一個缺點,不好懂。從風格上講,該書與其說是為學習者而寫作的教程范本,還不如說是給學術界人士看的學術報告,嚴謹有余,生動不足。這一點包括該書作者和象Bjarne Stroustrup這樣的大師都從不諱言。實際上Design Pattern并非一定是晦澀難懂的,通過生動的例子,一個中等水平的C++學習者完全可以掌握基本用法,在自己的編程實踐中使用,得到立竿見影的功效。這兩篇文章就是很好的例證。本文翻譯在保證技術完整性的前提下作了不少刪節和修改,以便使文章顯得更緊湊。
上傳時間: 2015-08-11
上傳用戶:270189020
本人初學c語言程序不是很拿手,n!的求法。。希望大家指教
上傳時間: 2015-08-13
上傳用戶:athjac
n皇后問題,rar格式,運行環境c++,n〉=1
標簽:
上傳時間: 2015-08-16
上傳用戶:helmos
This section contains a brief introduction to the C language. It is intended as a tutorial on the language, and aims at getting a reader new to C started as quickly as possible. It is certainly not intended as a substitute for any of the numerous textbooks on C. 2. write a recursive function FIB (n) to find out the nth element in theFibanocci sequence number which is 1,1,2,3,5,8,13,21,34,55,…3. write the prefix and postfix form of the following infix expressiona + b – c / d + e * f – g * h / i ^ j4. write a function to count the number of nodes in a binary tr
標簽: introduction the contains intended
上傳時間: 2013-12-23
上傳用戶:liansi
C語言 打印“魔方陣”,所謂魔方陣是指這樣的方陣 ,它的每一行,每一列和對角線之間和均相等。例如,三階魔方陣為 8 1 6 3 5 7 4 9 2 要求打印出1~n的平方數的自然數的魔方陣。
上傳時間: 2015-08-26
上傳用戶:er1219
C# BigInteger class. BigInteger.cs is a csharp program. It is the BIgInteger class. It has methods: abs() , FermatLittleTest(int confidence) ,gcd(BigInteger bi) , genCoPrime(int bits, Random rand) , genPseudoPrime(int bits, int confidence, Random rand) , genRandomBits(int bits, Random rand) , isProbablePrime(int confidence) , isProbablePrime() , Jacobi(BigInteger a, BigInteger b) , LucasSequence(BigInteger P, BigInteger Q, BigInteger k, BigInteger n) ,max(BigInteger bi) , min(BigInteger bi) , modInverse(BigInteger modulus) , RabinMillerTest(int confidence) ,
標簽: BigInteger class BIgInteger program
上傳時間: 2013-12-23
上傳用戶:ynzfm
這是個圖象壓縮解壓軟件的源碼,是純C語言編寫的。在VC環境下可以運行
上傳時間: 2014-01-02
上傳用戶:cuibaigao