原创 =====================

多做項目,多思考 不要害怕做事,剛畢業的同學最缺的就是工作經驗,亂七八糟的項目能讓你很快就瞭解了一個公司的業務與使用的技術,並且可以多接觸同事與客戶。 當你畢業後剛進一家公司時,如果主管沒有把你安排到項目組工作,那真的很杯具,因爲他認爲你

原创 C語言文件操作函數大全

   相關函數 feof    表頭文件 #include<stdio.h>    定義函數 void clearerr(FILE * stream);    函數說明 clearerr()清除參數stream指定的文件流所使用的錯誤旗標

原创 [算法]不使用*、/、+、-、%操作符求一個數的1/3

原地址:http://sd.csdn.net/a/20120807/2808268-divide-a-number-by-3-without-operators.html        導讀:算法一直是程序員進階的一道龍門,通常算法都是

原创 hdu 4357 String Change

比賽時A了。。。 以下轉自出題人解析: 當字符串長度爲2時:直接模擬即可(最多26次)。 當字符串長度大於2時: 1. 定義字符串的奇偶性爲該字符串所有字符之和的奇偶性。 2. 因爲每次變化操作字符串的字符和共增加了2,所以當字符串的奇偶

原创 hdu 1164 質因子分解 (篩素數模板)+ hdu 1215

#include <iostream> #define M 100000 // [1..M] #define clr(x, k) memset((x), (k), sizeof(x)) bool f[M]; int d[M], p=0;

原创 hdu 2037 貪心小水題

#include <cstdio> #include <cstdlib> using namespace std; struct time { int st, ed; }a[100]; int cmp(const void *a, c

原创 hdu 1159 Common Subsequence

#include <iostream> #include <string> #define N 1000 using namespace std; int f[N][N]; //只能開外面。。。 int main() { string

原创 hdu 1013

//題目沒給範圍,wa了一把。。。 #include <stdio.h> int main() { int a,c; for (;scanf("%1d",&a),a>0;printf("%d\n",--a%9u+1))

原创 hdu 1018 Stirling 求階乘位數

#include <iostream> #include <cmath> #define p acos(-1) #define e exp(1) #define f(n) ((0.5 * log(2 * p * n) + n * log(

原创 hdu 2059 第一道DP

dp[i] = min(dp[j] + time(j-->i) ) + t                        ì  len / vt1,   len <= c time(j-->i) =    í               

原创 hdu 1035

#include <iostream> #define M 15 using namespace std;// n s w e int move[4][2] = {-1,0,1,0,0,-1,0,1}; int map[M][M], s[

原创 hdu 3790 最短路spfa模板

#include <iostream> #include <cstdio> #include <cstring> #include <queue> #define clr(x, k) memset((x), (k), sizeof(x))

原创 不用SQRT開平方的C++代碼

定義  求一個數a的平方根的運算,叫做開平方(extraction of square root),其中a叫做被開方數。   a必須大於或等於零,即a爲非負數   開方公式   X(n + 1) = Xn + (A / Xn – X

原创 rmq 模板

#include <iostream> #include <cmath> using namespace std; #define N 50010 int maxl[N][16], minl[N][16]; int n, m, a[N]

原创 hdu水題十道,提高鳥語能力~~ 1032 1029 1033 1036 1037 1038 1039 1047 1856 1060 1061

1 hdu 1032 #include <iostream> using namespace std; int len(int n) { int s = 1; while (n!=1) { if (n&1) n = 3*n