原创 Print Calendar
1. Zeller Formulation it's wonderfull. https://www.zhihu.com/question/42879877/answer/593102704 2. Calendar Print #
原创 c++知識點累積
輸入輸出 輸入 cin >> 跳過空白字符(空格、換行符、製表符)。 #include <iostream> #include <string> int main() { using std::cout; using std::c
原创 getchar() 與 getch()
getchar()與getch()這兩個函數都是讀一個字符,但是它們有一個重要的差別,下面我在vs2010平臺舉例子來說明: example_01.c #include<stdio.h> #include<conio.h> int ma
原创 《讓makefile變得簡單》系列--第二章--讓我們來寫一個makefile
一個完整的makefile包含了什麼 顯示規則 隱式規則 變量 指令或者命令 註釋 分行 這裏描述2個概念:邏輯行、物理行 邏輯行:比如你在編程時,一行賦值語句,一行if判斷語句都是邏輯行,它可以很長,佔用多個物理行,也可以很
原创 《讓makefile變得簡單》系列--第一章
引言 makefile是一種文件類型,它指導怎麼編譯並且鏈接程序。所以,makefile文件只是告訴make怎麼去執行。 在本章節中,我們討論一個簡單的makefile,它描述了怎麼編譯和鏈接text editor。textedi
原创 標點符號中英文互譯(翻譯)
/ slash, divide, oblique 斜線,斜槓,除號 // slash-slash, comment 雙斜線,註釋符 # pound 井號 \ backslash, sometimes escape 反斜線轉義符,有時
原创 從零開始學python
print print輸出默認帶上換行,例如 print "hello, world!" 符串後會自動加一個換行。如果不想加上換行,那麼可以 print "hello, world!", print "oh, beautiful wo
原创 c++關鍵字累積
final 指定符 (C++11 起) 在C++11中關鍵字final,用來指定派生類不能覆寫虛函數,或類不能被繼承。應用到成員函數時,標識符final 在類定義中的成員函數聲明或成員函數定義的語法中,立即出現於聲明器後。應用到類時,
原创 編程時要用到的按鍵ASCII碼值
ASCII碼值 控制字符 ASCII碼值 控制字符 ASCII碼值 控制字符 ASCII碼值 控制字符 0 NUT 32 64 96 1 SOH 33 65 97 2 STX 34 66 98 3 ET
原创 多線程編程
線程 創建線程pthread_create /* Create a new thread, starting with execution of START-ROUTINE getting passed ARG. Creat
原创 LeetCode Rotate Array
Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7]
原创 有關於變量類型的隱含問題
在C編程的時候,經常遇到類型轉換(強制類型轉換和隱式類型轉換)問題,比如無符號整型到短整型轉換(位截斷),無符號短整型到有符號整型的轉換(位擴展)。如果不瞭解類型轉換的內在原理,寫好的代碼可能會出現意想不到的問題。類型轉換如果從變量的字節
原创 新手安裝Ubuntu 16.04 操作系統
一、在windows操作系統下準備ubuntu系統的安裝盤1. 下載ubuntu的ISO文件這一步相對簡單,網絡上面有很多的鏈接下載。這裏貼一個ubuntu的官方網站鏈接,可以下載到ubuntu 16.04的iso文件https://wi
原创 LeetCode Remove Element
Given an array and a value, remove all instances of that value in place and return the new length. The order of element
原创 LeetCode Valid Parentheses
char CharRotate(char *ch) { if(*ch == '}') return '{'; else if(*ch == ')') return '('; else if(*ch ==