Time of Update: 2015-07-01
標籤:http://www.jb51.net/LINUXjishu/39614.html CentOS #include <uuid/uuid.h> 找不到檔案解決方案:sudo yum install e2fsprogs-develsudo yum install uuid-develsudo yum install libuuid-devel http://blog.csdn.net/iw1210/article/details/173
Time of Update: 2015-07-01
標籤://input.c中要處理的情況如下input.c/*int i = 0;*//*int y = 0;*/int j = 0;/*int x = 0;/*12345678*//*int h = 0;int g = 0;int j = 0;*/int q = 0;/**//**//* ****** */// /*1234567890*/源檔案Annotationconvert.c<span
Time of Update: 2015-07-01
標籤:模板遞迴#include <iostream>using namespace std;template<int N>class A{public: enum{ result = N + A<N - 1>::result};};template<>class A<1>{public: enum{result=1};};int main(){ cout << A<500>::result
Time of Update: 2015-07-01
標籤:看python發現有這麼個api,感覺很實用,想著stl裡會不會有這個呢?查了半天毫無結果。於是用lambda自己實現了下。以vector為例template<typename T>vector<int> argsort(const vector<T>& a){ int Len = a.size(); vector<int> idx(Len,
Time of Update: 2015-07-01
標籤:rt 根據所具有的Unicode編碼用C#語言把它轉換成漢字的代碼師傅的代碼: public static string UnicodeToGB(string text) {
Time of Update: 2015-07-01
標籤:c c++ #include <iostream>#include <string>#include <cassert>#include <algorithm>#include <vector>using namespace std;class Sales_data{ friend std::istream&
Time of Update: 2015-07-01
標籤:#include <stdio.h>#include <stdlib.h>#include <Windows.h>//直接插入排序void InsertSort(int arry[], int n){ int i, j; int temp;//臨時變數 for (i = 1; i < n; i++) { temp = arry[i]; for (j = i - 1; j >= 0; j--)
Time of Update: 2015-07-01
標籤:什麼是重載:讓操作符具有自己想要的功能。#ifndef _ARRAY_H_#define _ARRAY_H_class Array{private: int mLength; int* mSpace;public: Array(int length); Array(const Array& obj); int length(); void setData(int index, int value); int getData(int
Time of Update: 2015-07-01
標籤:1.宏定義可以分為2種:不帶參數的宏定義 帶參數的宏定義2.定義一般形式#define 宏名 字串比如 #define ABC 10右邊的字串也可以省略,比如#define ABC3.作用它的作用是在編譯預先處理時,將來源程式中所有"宏名"替換成右邊的"字串",常用來定義常量。接下來寫個程式根據圓的半徑計算周長4.例子在第4行定義了一個叫PI的宏,在編譯預先處理之後,第8行中的2 * PI *radius就會變成2 * 3.14 * radius。 1 #include
Time of Update: 2015-07-01
標籤:man命令可以查看c語言庫函數的函數原型, 比如$ man malloc如果顯示 "No manual entry for malloc", 則需要安裝 "man-pages"sudo yum -y install man-pages Linux 中的 man 就是 manual 的縮寫, 用來查看系統中內建的各種參考手冊, 但是手冊頁分為好幾個部分,如下所示:(註:手冊頁, 很重要的, 一般我們也都沒有用上,不過有時候, 你就會發現你用上了)1.Executable
Time of Update: 2015-07-01
標籤:python c++ 1、下載boost1.52,http://www.boost.org/,解壓檔案到d:\boost\boost_1_52_0;2、下載python2.7.3,http://www.python.org/;(boost1.4支援到python2.5)3、安裝python,我安裝在了D:\Python25,設定環境變數PATH D:\Python25;4、開始->程式->Microsoft
Time of Update: 2015-07-01
標籤:c#最近偶簡單的複習了下在C#中涉及到繼承這個特性時,所需要用到的關鍵字,其中有一些關鍵點,特地整理出來,方便大家查閱。在微軟的一次筆試和面試中也提到了這個問題:一、在C#中,new這個關鍵字使用頻率非常高,主要有3個功能:a) 作為運算子用來建立一個對象和調用建構函式。b) 作為修飾符。c)
Time of Update: 2015-07-01
標籤: 最近在學設計模式,學到建立型模式的時候,碰到單例模式(或叫單件模式),現在整理一下筆記。 在《Design Patterns:Elements of Resuable Object-Oriented Software》中的定義是:Ensure a class only has one instance,and provide a global point of access
Time of Update: 2015-07-01
標籤:C#中運行PowerShell需要用到System.Management.Automation.dll。在Visual Studio中可以通過NuGet添加引用,package名字為“System.Management.Automation”。 Runspace runspace = RunspaceFactory.CreateRunspace();runspace.Open();using (Pipeline pipeline = runspace.CreatePipeline()) {
Time of Update: 2015-07-01
標籤:自動屬性初始化 (Initializers for auto-properties)以前我們是這麼寫的為一個預設值加一個後台欄位是不是很不爽,現在我們可以這樣寫唯讀屬性的初始化(Getter-only auto-properties)像使用者ID這種唯讀屬性,我們以前是這樣寫的現在我們可以這樣寫唯讀屬性可以和標了readonly的欄位一樣在建構函式裡面賦值。用Lambda作為函數體 (Expression bodies on method-like
Time of Update: 2015-07-01
標籤:擴充方法擴充方法所在的類和擴充方法必須是靜態 並且擴充方法第一個參數是要擴充的類名 並在thisPerson person = new Person();public static class Extension { public static void ExtensionMethod(this Person
Time of Update: 2015-07-01
標籤:1.dynamic ExpandoObject熟悉js的朋友都知道js可以這麼寫 :複製代碼 代碼如下:var t = new Object(); t.Abc = ‘something‘; t.Value = 243; 現在這個js動態語言的特性,我們也可以在c#中使用了,前提是將一個變數聲明為ExpandoObject類型。如下例:複製代碼 代碼如下:static void Main(string[] args) { dynamic t = new
Time of Update: 2015-07-01
標籤:資訊 環境 代碼 伺服器環境資訊【C#代碼擷取】public class ServicesMessage { [DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)] internal static extern void
Time of Update: 2015-07-01
標籤:1.逆序的三位元(5分)題目內容:程式每次讀入一個正三位元,然後輸出逆序的數字。注意,當輸入的數字含有結尾的0時,輸出不應帶有前置的0。比如輸入700,輸出應該是7。輸入格式:每個測試是一個3位的正整數。輸出格式:輸出逆序的數。輸入範例:123輸出範例:321時間限制:500ms記憶體限制:32000kb 2.時間換算(5分)題目內容:UTC是世界協調時,BJT是北京時間,UTC時間相當於BJT減去8。現在,你的程式要讀入一個整數,表示BJT的時和分。整數的個位和十位
Time of Update: 2015-07-01
標籤:因為期末,很久沒刷題了,CF一直掉……這個題其實很簡單。。因為做法很容易想到嘛。。就是枚舉max=x時,最大能保留多少價值,不斷更新ans,結果就是所有價值和減去ans就好由於最大能夠保留的長度是199+200,所以當max=x時,算最大能保留多少價值,也是一個迴圈算出當前長度比x小的那個桌子角的最大的那幾個價值之和保留就行了,這裡寫的比較繞。。反正看看代碼一下就懂了。。。維護一個map就行了比賽的時候,因為好久沒刷題了,一直