標籤:最大公約數/*編寫一個函數,傳入a,b兩個int類型的變數,返回兩個值的最大公約數。例如:輸入傳入(0 , 5)函數返回5,傳入(10 , 9)函數返回1,傳入(12 , 4)函數返回4*/#include <stdio.h>int yue( int x, int y ){int temp,min;if( x > y ){temp = x;x = y;y = temp;}min = x;if( min == 0 )return y;while( min != 0
標籤:c++1 基本概念1.1 meta program 元程式可以用meta program產生object program, 也可以object program作為資料看待,從而組裝出更大的object program 元程式是處理常式的程式,如大家熟悉的編譯器、解譯器、類型檢查器、定理證明器、程式產生器、轉換系統和程式分析器等等1.2 object program
標籤:<pre name="code" class="cpp">/*在終端輸入多行資訊,找出包含"ould"的行,並列印改行如:Au,love could you and I with fate conspireTo grasp this sorry scheme of things entire,Would not we shatter it to bitd - and then.在終端輸出上述的文字,輸出Au,love
標籤:C語言中基礎資料型別 (Elementary Data Type)共分為三類:分別為整型、浮點型、和字元型。整型(int):整型資料包含了所有的整數,例如:20、15、-19、987等浮點型(float\double):float:單精確度浮點型,也是小數,比double的精確程度低,也就是說所能表示的小數位元比較少。為了跟double區分開來,float 型資料都是以f結尾的,比如8.26f、-3.19f、0.0f。需要注意的是,絕對不能有100f這樣格式的,編譯器會直接報錯,
標籤: 本周學到很多C#關於Interface, Array的知識,在這裡簡單複習一下幾個易混的地方,重在理解。 一、Interface 使用as來避免多態時沒有介面的Exception:Document [] folder = new Document[5];for (int i = 0; i < 5; i++){ if (i % 2 == 0) { folder[i] = new
標籤:C - Monkey and BananaTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA group of researchers are designing an experiment to test