原创 HDU1008

#include <iostream> #include <cmath> using namespace std; int caculate_time(int a, int b); int main() { int n, i, tim

原创 十進制轉化爲二進制

#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int n; string str; whi

原创 字符串處理

/*輸入:2 ABC ABBCCC 輸出: ABC A2B3C Tips:一邊處理,一邊輸出 */ #include <iostream> #include <string> using name

原创 等比數列求和

/*等比數列求和 輸入:輸入數據不多於50對,每對數據含有一個整數n(1<=n<=20),一個小數q(0<q<2) 輸出:求和,1+q^2+...+q^n 精確到小數點後3位 */ #include <iostream> #include

原创 斐波那契數

//輸入:正整數n(0<=n<=46) //輸出:第n項斐波那契數 //Tips: 先把前46項斐波那契數求粗來,放到數組中或向量中 #include <iostream> #include <vector> using namespac

原创 寫在開始

經歷了大一那段現在回憶起來荒廢時間的日子,覺得很可惜,可是都是過去了。大二上學期,不知怎麼突然就看起了c++,不知從哪天開始,發現自己已經走上這條“不歸路”。自己本身並不是計算機相關專業。 大學一年級,可以被叫做渾渾噩噩的混過來,浪費了時

原创 ACM中常見數據輸入格式總結

最開始自己學習編程的時候,輸入的數據往往是一次性輸入,回車得到結果就完了,請按任意鍵繼續….但是當接觸oj上的題目後,起初感覺很困惑,他往往有多組測試數據,我就想這是不是要一次把測試數據全部輸入進去然後再得到多組結果,但是一想不對…總之很

原创 POJ1328 Radar Installation

Description Assume thecoasting is an infinite straight line. Land is in one side of coasting, sea inthe other. Each