#include <stdio.h>#include <stdlib.h>#include <conio.h>#define X " Sun Mon Tue Wed Thu Fri Sat"#define P printf#define B break#define FP fprintfvoid print(int n){ int i; for(i=0;i<n;i++) printf(" ");}int day(int year){ long a,b;
原貼最初發表在QQ空間:普通C++程式員 VS 文藝C++程式員,http://user.qzone.qq.com/31731705/blog/1323153107 BBS上看到一個講C++的文章, C++ 這孩子 是不是誤入歧途了?,讓我想起了普通青年和文藝青年。 看這個經典的NB程式,求一個數有多少bit。J普通C++程式員namespace traditional { int bits_of(int remain) { if (remain) return 1+bits_of(
<深度探索C++物件模型>>(簡體版)中的蛇足(沒有此書的人請勿看)上次見到這本書是一年前(是候先生的繁體版),花了一個星期的時間讀完,囫圇吞棗,不求甚解,饒是如此,也解決了我在C++方面的諸多疑惑,這次終於看到了簡體版,同樣花了一個星期,或許真的是一回生,兩回熟吧(也可能是對簡體文字的親切感^_^),思考問題的同時也發現了一些問題,一愚之見,不吐不快。蛇足之一,P84,class X {};class Y : public virtual X {};class Z :
最初發表在QQ空間:標準C++中實現線程類 標準C++和標準庫中沒有對線程的封裝,程式員們不得不使用OS提供的API來處理線程,OS層級的API通常基於C,能用,但並不方便。最近看到論壇上有人問,順便和同事討論這個問題,如何使用標準C++封裝線程的操作,目的就是simple and easy to use。想想自己似乎多年前(已經結蜘蛛網了)寫過這方面的代碼,找了找,還真找到了,是Windows平台的,整理一下,與大家分享。// 抽象類別,作為線程類的基類,定義了幾個介面//
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPermutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers, each of them doesn't exceed n. We'll
time limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya is writing an operating system shell, and it should have commands for working with directories. To begin with, he decided to go with just two