??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲愉拍99热成人精品热久久,精品国产91久久久久久久,久久精品中文字幕第23页 http://www.shnenglu.com/flyinghearts/zh-cn Tue, 06 May 2025 19:49:16 GMT Tue, 06 May 2025 19:49:16 GMT 60 SEH异常处理专利到期?/title> http://www.shnenglu.com/flyinghearts/archive/2014/06/15/207288.htmlflyinghearts flyinghearts Sun, 15 Jun 2014 02:55:00 GMT http://www.shnenglu.com/flyinghearts/archive/2014/06/15/207288.html http://www.shnenglu.com/flyinghearts/comments/207288.html http://www.shnenglu.com/flyinghearts/archive/2014/06/15/207288.html#Feedback 3 http://www.shnenglu.com/flyinghearts/comments/commentRss/207288.html http://www.shnenglu.com/flyinghearts/services/trackbacks/207288.html Borland的那个恶心的SEH异常处理专利QNo:5,628,016 Filed: June, 15, 1997Q,l于到期了。希望GCC/CLANG能快点完成win32的C++异常的SEH实现Q下一版本的GCCQ能让用户不再纠lSJLJQDwarf2的选择?br /> ]]> 面试? 扑և数组中三个只出现一ơ的?/title> http://www.shnenglu.com/flyinghearts/archive/2013/03/21/198695.htmlflyinghearts flyinghearts Thu, 21 Mar 2013 14:00:00 GMT http://www.shnenglu.com/flyinghearts/archive/2013/03/21/198695.html http://www.shnenglu.com/flyinghearts/comments/198695.html http://www.shnenglu.com/flyinghearts/archive/2013/03/21/198695.html#Feedback 4 http://www.shnenglu.com/flyinghearts/comments/commentRss/198695.html http://www.shnenglu.com/flyinghearts/services/trackbacks/198695.html
题目Q数l中有三个数只出Cơ,其它的数恰好出现两次Q找三个数?/span>
先考虑“只有两个数出C?#8221;的情况:可以扑ֈ一U方法,数l划分ؓ两部分,且让q两个数分别在不同部分,q样每部分所有数的异或|恰好分别{于q两个数。一U简单的分法是Q先计算两个数的异或?/span>MQ等价于求数l中所有数的异或|Q求?/span>M值的二进制表CZ的最低位 1Q其它位?/span>1也可以,只不q麻烦点Q在 +k位,然后Ҏ +k位是否ؓ 1Q将原数l分Z部分?/span>
回到原题Q假设这三个不同的数是: A?/span>B?/span>CQ它们的异或?/span> X = A xor B xor C Q?/span>X值可能ؓ 0Q也可能不ؓ 0。当 Xg?/span>0Ӟ比如Q这三个Cؓ 3?/span>5?/span>7Q?/span>Xgؓ 1Q,很难扑ֈ一U方法,原来的数组划分Z部分Q得这三个C都在同一部分。因而,要先对原来的数组q行一ơ替换:每个数?/strong> X q行异或 。这样原来的三个数就变成了:
B xor C?/span>A xor C?/span>A xor B。记 a = B xor C ?/span> b = A xor C ?/span> c = A xor B 。新的异或?/span> x = a xor b xor c = 0 ?/span>
׃ A?/span>B?/span>C互不相等Q显然它们间的异或?/span>a ?/span> b ?/span> c 都不?/span> 0 Q且互不相等 。(?/span>a{于 bQ则 0 = a xor b = (B xor C) xor (A xor C) = A xor B != 0 自相矛盾Q?/span>
若三个数的异或gؓ 0 Q且其中一个数?/span> +n 位( n ZQ意|上ؓ 1 Q则另两个数?/span> +n 位上必然一个ؓ 1 Q另一个ؓ 0 Q不然的话,q三个数的异或值就不会?/span>0Q,因而根?/span> +n 位ؓ 1 Q可以将q三个数分成两部?/span> ?/span>
?/span> f(x) ?/span> x 的二q制表示中最低位 1 的位|,?/span> f(a) ?/span> f(b) ?/span> f(c) q三个数中有且只有两个数相等 。证明:不妨?/span>f(a)?/span>f(b)?/span>f(c)中最的?/span>f(a)Q?/span>k = f(a)Q则 b?/span>c?/span> +k位上必然是一个ؓ 1Q一个ؓ 0Q不妨设 b?/span> +k位ؓ 1Q则Ҏ f(x)的定义以?/span>f(a)最,可得 f(b){于 f(a)Q?/span>f(c)大于 f(a)。因而,新数l的?/span>x对应的所?/span>f(x)的d或值等?/span>f(c)?/span>
假设 f(a){于 f(b)Q?/span>m = f(c)Q由?/span>c?/span> +m位上?/span>1Q不妨设 b?/span> +m位也?/span>1Q则 a?/span> +m位ؓ 0。根?/span> +m位是否ؓ 1Q可新数组分ؓ两部分,每部分的异或值恰好都?/span> a = B xor C Q可以求出数 AQ等?/span>a xor XQ?/span> 数 A攑օ原来的数l,问题转ؓ “只有两个数出C?#8221;的情况,利用前面提到的方法算出另两个数。d需遍历数组 4ơ?/span>
代码Q?/span>
#include <cstdio>
#include <cassert>
static inline int extract_rightmost_one ( unsigned value ) { return value & - value ; }
// if a != b, m = extract_rightmost_one(a), n = extract_rightmost_one(b),
// k = extract_rightmost_one(a ^ b)
// then m == n != k or m == k != n or n == k != m
void print_three_unique_number ( const int arr [], unsigned len )
{
assert ( len >= 3 && len % 2 );
const int * const beg = arr ;
const int * const end = arr + len ;
int xor3 = 0 ;
for ( const int * p = beg ; p != end ; ++ p ) xor3 ^= * p ;
int flag1 = 0 ;
for ( const int * p = beg ; p != end ; ++ p ) flag1 ^= extract_rightmost_one (* p ^ xor3 );
assert ( flag1 != 0 && ( flag1 & ( flag1 - 1u )) == 0u ); // flag1 == 2^^k
int xor2 = 0 ;
for ( const int * p = beg ; p != end ; ++ p ) {
const int value = * p ^ xor3 ;
if ( value & flag1 ) xor2 ^= value ; //or:
// if ((value & flag1) == 0) xor2 ^= value;
}
const int number1 = xor2 ^ xor3 ;
const int flag2 = extract_rightmost_one ( xor2 );
int number2 = ( number1 & flag2 ) ? number1 : 0 ; // put number1 in to the array
for ( const int * p = beg ; p != end ; ++ p ) {
if (* p & flag2 ) number2 ^= * p ;
}
const int number3 = xor2 ^ number2 ;
printf ( "%d %d %d\n" , number1 , number2 , number3 );
}
上面的代码ƈ不严格符?/span>C++标准Q而是假定机器采用补码表示负数Q不采用补码表示的老古董,一般h也碰不到Q?/span> 另外要特别注意的是,一些计最好先转ؓ无符hQ避免溢出,最后再转回有符h。因为标准假定有W号数间的计不发生溢出Q当实际上发生溢出时Q就?/span>UB行ؓQ编译器若进行些Ȁq的优化得不到正确l果?/span>
]]>mingw gcc的头文g存在l构定义错误Q! http://www.shnenglu.com/flyinghearts/archive/2013/03/21/198694.htmlflyinghearts flyinghearts Thu, 21 Mar 2013 13:51:00 GMT http://www.shnenglu.com/flyinghearts/archive/2013/03/21/198694.html http://www.shnenglu.com/flyinghearts/comments/198694.html http://www.shnenglu.com/flyinghearts/archive/2013/03/21/198694.html#Feedback 0 http://www.shnenglu.com/flyinghearts/comments/commentRss/198694.html http://www.shnenglu.com/flyinghearts/services/trackbacks/198694.html 准确的讲是mingw所用的sdk —— w32apiQ存在结构定义错误?br /> 打开wingdi.h 定位?tagGCP_RESULTSW 的结构定义位|, typedef struct tagGCP_RESULTSW { DWORD lStructSize; LPWSTR lpOutString; UINT *lpOrder; int *lpDx; int *lpCaretPos; LPWSTR lpClass; //正确的类型应该是 LPSTR LPWSTR lpGlyphs; UINT nGlyphs; int nMaxFit; } GCP_RESULTSW,*LPGCP_RESULTSW; Ҏmsdn, lpClass的类型应该是 LPSTRQ?w32api却将其声明ؓ LPWSTR?br /> q个bugQ在2011q就有h报告了,据说cvs版本也修正了Q但是直到现在,官方下蝲q是2011q发布的那个有bug的版本(w32api-3.17-2-mingw32-dev.tar.lzmaQ?br /> 另外Qmingw-w64Q支持生?2位?4位程序)不存在这个问题?
]]> c++11 最反直觉的地方 http://www.shnenglu.com/flyinghearts/archive/2012/11/22/195570.htmlflyinghearts flyinghearts Thu, 22 Nov 2012 11:49:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/11/22/195570.html http://www.shnenglu.com/flyinghearts/comments/195570.html http://www.shnenglu.com/flyinghearts/archive/2012/11/22/195570.html#Feedback 4 http://www.shnenglu.com/flyinghearts/comments/commentRss/195570.html http://www.shnenglu.com/flyinghearts/services/trackbacks/195570.html 1 auto 会自动把 引用 去除?br /> int& get(); auto k = get(); // k的类型是intQ而不是int& Derived object; auto& same_object = (Base&)object; auto another_object = (Base&)object; //会重新构造个Base对象 2 decltype 有时会自动把 引用 加上 int x; decltype((x)) ?decltype(*&x) 的类型是int&Q而不是int 在宏中用decltypeӞ要特别注意别多加了括受?br /> 下面q段代码错在哪里Q?br /> template<typename T, typename R> auto min(T t, R r) -> decltype(t < r ? t : r) { return (t < r ? t : r); } decltype(t < r ? t : r)的类型是T&或R&Q而不是所希望的T或RQ?br /> 标准是这栯定的Q?br /> The type denoted by decltype(e) is defined as follows: — if e is an unparenthesized id-expression or an unparenthesized class member access (5.2.5), decltype(e) is the type of the entity named by e. If there is no such entity, or if e names a set of overloaded functions, the program is ill-formed; — otherwise, if e is an xvalue, decltype(e) is T&&, where T is the type of e; — otherwise, if e is an lvalue, decltype(e) is T&, where T is the type of e; — otherwise, decltype(e) is the type of e. 3 std::move、std::forward、右值引?br /> C++11 引入 叛_引用,可以做到Q函数{发、针对时对象优?br /> move是动词,从字面上理解好像是要Ud对象Q其实std::move只是单的类型{成右值引用而已Q!Q?可以理解?cast_to_rvalue_reference ?treat_as_temporal_object?br /> void test1(int&&) {} void test2(int&& value) //注意Qvalue的类型是intQ而不是int&& { test1(value); //无法~译通过Q因为value的类型是intQ?必须转换cd test1(static_cast<int&&>(value)); //或?br /> test1(std::forward<int>(value)); } test2函数中,value的类型是intQ而不是int&&?br /> q是一个不得已的选择。如果value的类型是int&&的话Q就会有副作用: void increase(int& value) { ++value; } void test3(int&& value) { increase(value); } char ch = 'a'; test3(ch); //本意是改变ch|但实际上chg会改变,改变的是临时对像 通过转发函数test3Qincrease函数可以修改临时对像Q?br /> q造成E序员犯的错误(如上面的例子Q,难以在编译时p扑և来?br /> std::forward<T>(value) {h?static_cast<T&&>(value)Q感觉后者更Ҏ理解?br /> std::forward 起到的{发作用。如果Tcd?R&?R&&Q经q类型{换后Q其cdq是和原来的一栗?br /> 在C++11? R& & {同?R& Q在c++03中,R& &q种写法是非法的Q?br /> R&& & {同?R& R& && {同?R& R&& && {同?R&& ]]>decltype的小“陷阱?/title> http://www.shnenglu.com/flyinghearts/archive/2012/08/14/187204.htmlflyinghearts flyinghearts Tue, 14 Aug 2012 13:19:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/08/14/187204.html http://www.shnenglu.com/flyinghearts/comments/187204.html http://www.shnenglu.com/flyinghearts/archive/2012/08/14/187204.html#Feedback 5 http://www.shnenglu.com/flyinghearts/comments/commentRss/187204.html http://www.shnenglu.com/flyinghearts/services/trackbacks/187204.html decltype(x) ?nbsp; decltype((x)) 的类型是不一L?/div>
decltype(x) ?nbsp; decltype(*&x) 的类型是不一L?br />
decltype(x)的类型是 int
decltype((x)) ?decltype(*&x) 的类型是 int&
C++11标准Q?/div>
The type denoted by decltype(e) is defined as follows: — if e is an unparenthesized id-expression or an unparenthesized class member access (5.2.5), decltype(e) is the type of the entity named by e. If there is no such entity, or if e names a set of overloaded functions, the program is ill-formed; — otherwise, if e is an xvalue, decltype(e) is T&&, where T is the type of e; — otherwise, if e is an lvalue, decltype(e) is T&, where T is the type of e; — otherwise, decltype(e) is the type of e.
]]>
内嵌汇编实现的函数{?/title> http://www.shnenglu.com/flyinghearts/archive/2012/08/05/186382.htmlflyinghearts flyinghearts Sun, 05 Aug 2012 13:02:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/08/05/186382.html http://www.shnenglu.com/flyinghearts/comments/186382.html http://www.shnenglu.com/flyinghearts/archive/2012/08/05/186382.html#Feedback 8 http://www.shnenglu.com/flyinghearts/comments/commentRss/186382.html http://www.shnenglu.com/flyinghearts/services/trackbacks/186382.html 调用CALL(func)Q{用func()Q?div> 调用CALL(func, arg1, arg2) Q{用func(arg1, arg2) 代码中,宏CALL/STDCALL分别用来调用 __cdecl/__stdcall 调用规定的函?br /> unsafe_call 两者都可调用,但它不是多线E安全的?br /> 代码只支持x86 32位, 除内嵌汇~部分,量W合C++11标准?br />
原理Q?br /> 刚进入函数时Q?br /> [esp] 函数q回地址
[esp + 4] W一个参敎ͼ卌{发函数的地址
[esp + 8] W二个参敎ͼ卌{发函数的的第一个参?/div> ...
只要写三行汇~指令实C个c_call函数Q就可调用{发函?br />
pop eax ; eax为函数返回地址
xchg dword ptr[esp], eax ; eax{发函数的地址Q[esp]为函数返回地址
jmp eax
当{发函数是__cdeclQ即转发函数不会调节栈,׃在c_callQpop eaxQesp多加?Q因而在调用完c_call后应该手动将esp值减4Q保证栈q?br />
当{发函数是__stdcallQ{发函C调节栈,调用转发函数完毕后,栈已l保持^衡,因而调用c_call完毕Q不应该q行栈指针调节。似乎将c_call的调用改为__stdcall卛_Q但实际上c_call有变长参敎ͼҎ__stdcall没效果,每次调用~译器还是会自动生成调节栈指针代码。因而只能每ơ调用完毕,~译器给esp加了多少Q就手动减多。(~译器不一定会生成 call xxxx; add esp, xxq样的代码,通过改函数返回地址Q忽略后面的add esp, xx指o是很p糕的做法。)
call_redirect 1 #include < cstdio > 2 #include < cstdarg > 3 #include < windows.h > 4 5 #define CALL( ) c_call(__VA_ARGS__); ASM_SUB_ESP(4); 6 #define STDCALL( ) c_call(__VA_ARGS__); ASM_SUB_ESP(MACRO_ARGS(__VA_ARGS__) * 4); 7 8 #define MACRO_EXPAND(x) x 9 #define MACRO_NTH_ARG(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, ) a9 10 #define MACRO_ARGS( ) \ 11 MACRO_EXPAND(MACRO_NTH_ARG(__VA_ARGS__, 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 )) 12 13 #if __GNUC__ 14 // please enable option, -masm=intel 15 #define ASM_SUB_ESP(x) asm("lea esp, dword ptr[esp - %0]" : : "i"(x)) 16 17 int c_call( void * pfn, ) asm( " c_call " ); 18 asm( " \n\ 19 c_call: \n\ 20 pop eax; \n\ 21 xchg dword ptr[esp], eax; \n\ 22 jmp eax; \n\ 23 " ); 24 25 int unsafe_call( void * pfn, ) asm( " unsafe_call " ); 26 asm( " \n\ 27 .lcomm old_ret_addr, 4 \n\ 28 .lcomm old_esp_value, 4 \n\ 29 unsafe_call: \n\ 30 pop dword ptr old_ret_addr; \n\ 31 mov dword ptr old_esp_value, esp; \n\ 32 mov eax, dword ptr[esp]; \n\ 33 mov dword ptr[esp], offset last; \n\ 34 jmp eax; \n\ 35 last: \n\ 36 mov esp, dword ptr old_esp_value; \n\ 37 jmp dword ptr old_ret_addr; \n\ 38 " ); 39 40 #elif _MSC_VER 41 #define ASM_SUB_ESP(x) __asm lea esp, dword ptr [esp - x] 42 43 __declspec(naked) int c_call( void * pfn, ) 44 { 45 __asm { 46 pop eax; 47 xchg dword ptr[esp], eax; 48 jmp eax; 49 } 50 } 51 __declspec(naked) int unsafe_call( void * pfn, ) 52 { 53 static void * old_ret_addr; 54 static void * old_esp_value; 55 __asm { 56 pop old_ret_addr; 57 mov old_esp_value, esp; 58 mov eax, dword ptr[esp]; 59 mov dword ptr[esp], offset last; 60 jmp eax; 61 last: 62 mov esp, old_esp_value; 63 jmp old_ret_addr; 64 } 65 } 66 67 #else 68 #error "only gcc and msvc are supported" 69 #endif 70 71 72 void show( const char * format, ) 73 { 74 va_list args; 75 va_start(args, format); 76 vprintf(format, args); 77 va_end (args); 78 } 79 80 void mysleep() { Sleep( 10 ); } 81 82 void test1() 83 { 84 int a = 5 , b = 6 ; 85 show( " %d + %d = %d\n " , a, b, a + b); 86 CALL(( void * )printf, " %d + %d = %d\n " , a, b, a + b); 87 CALL(( void * )mysleep); 88 CALL(( void * )show, " %d + %d = %d\n " , a, b, a + b); 89 } 90 91 void test2() 92 { 93 STDCALL(( void * )MessageBoxA, NULL, " text1 " , " caption1 " , MB_OK); 94 STDCALL(( void * )Sleep, 10 ); 95 STDCALL(( void * )MessageBoxA, NULL, " text2 " , " caption2 " , MB_OK); 96 STDCALL(( void * )Sleep, 100 ); 97 } 98 99 void test3() 100 { 101 int a = 5 , b = 6 ; 102 unsafe_call(( void * )printf, " %d + %d = %d\n " , a, b, a + b); 103 unsafe_call(( void * )mysleep); 104 unsafe_call(( void * )show, " %d + %d = %d\n " , a, b, a + b); 105 unsafe_call(( void * )MessageBoxA, NULL, " text1 " , " caption1 " , MB_OK); 106 unsafe_call(( void * )Sleep, 10 ); 107 unsafe_call(( void * )MessageBoxA, NULL, " text2 " , " caption2 " , MB_OK); 108 unsafe_call(( void * )Sleep, 100 ); 109 } 110 111 int main() 112 { 113 test1(); 114 test2(); 115 test3(); 116 return 0 ; 117 } 118 119 120 ]]>
一些老游戏CPU 100%占用的解x?/title> http://www.shnenglu.com/flyinghearts/archive/2012/05/15/175005.htmlflyinghearts flyinghearts Tue, 15 May 2012 12:26:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/05/15/175005.html http://www.shnenglu.com/flyinghearts/comments/175005.html http://www.shnenglu.com/flyinghearts/archive/2012/05/15/175005.html#Feedback 0 http://www.shnenglu.com/flyinghearts/comments/commentRss/175005.html http://www.shnenglu.com/flyinghearts/services/trackbacks/175005.html 下蝲Q?a href="/Files/flyinghearts/peekmsg.7z" title="peekmsg">peekmsg用法Q?br /> peekmsg.exe 游戏ȝ?br /> 或用lordpeQ打开游戏ȝ序,导入peekmsg.dll中的init
原理Q?br /> hook PeekMessage函数Q用Sleep、WaitForMultipleObjects{函数让出CPU旉片?
]]> 三国?剧本修改?1.2 http://www.shnenglu.com/flyinghearts/archive/2012/05/15/175004.htmlflyinghearts flyinghearts Tue, 15 May 2012 12:14:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/05/15/175004.html http://www.shnenglu.com/flyinghearts/comments/175004.html http://www.shnenglu.com/flyinghearts/archive/2012/05/15/175004.html#Feedback 0 http://www.shnenglu.com/flyinghearts/comments/commentRss/175004.html http://www.shnenglu.com/flyinghearts/services/trackbacks/175004.html 内置剧本改ؓ加强版剧本,保存剧本Ӟ同时生成普通版/加强版剧本?br />Q没旉试Q可能在更改宝物所有者时Q会有一些bugQ?br />三国?剧本修改?.2 ]]> 安全的整数比?/title> http://www.shnenglu.com/flyinghearts/archive/2012/03/30/169554.htmlflyinghearts flyinghearts Fri, 30 Mar 2012 12:16:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/03/30/169554.html http://www.shnenglu.com/flyinghearts/comments/169554.html http://www.shnenglu.com/flyinghearts/archive/2012/03/30/169554.html#Feedback 4 http://www.shnenglu.com/flyinghearts/comments/commentRss/169554.html http://www.shnenglu.com/flyinghearts/services/trackbacks/169554.html 前几天在水母上看到的题:正常的比?assert(-1 < 1U) 是会p|的。因?-1 会提升成无符h?br />写一个安全的比较函数Q?br />template <typename T1, typename T2> int SafeIntCompare(T1 i1, T2 i2); 如果 i1 真实?< i2Q返?-1 i1 真实?== i2Q返?nbsp; 0 i1 真实?> i2Q返?nbsp; 1
只有当两个类型一个是有符受另一个是无符hQ才需要特D处理?br />对类型的W号判断Q可以直接判断该cd?1是否?,也可以用标准库std::numeric_limits<T>中的is_signed成员?br /> 单的做法Q?br />template < typename T1, typename T2 > int SafeIntCompare(T1 v1, T2 v2) { static const bool t1 = std::numeric_limits < T1 > ::is_signed; static const bool t2 = std::numeric_limits < T2 > ::is_signed; if (t1 != t2) { if (t1 && v1 < 0 ) return - 1 ; if (t2 && v2 < 0 ) return 1 ; } if (v1 == v2) return 0 ; if (v1 < v2) return - 1 ; return 1 ; }
但由于进行比较的两个数可能分别是Q有W号数和无符hQ编译时~译器会l出大量的警告?br />
要避免有W号数和无符h的进行直接比较,必d它们都{为同一个类型T。这个类型的定可以采用两种ҎQ?br />
1 比较原来两个cd是否是有W号C及它们所占用的字节数Q来推断出应该将它们都{为哪U类型TQ这是vc那个safeint的做法?br />
2 采用q个trickQ将q两个类型的敎ͼ数可以取0Q直接相加,得到的结果的cd是所求的。这是因为:两个数进行比较时Q采用的cd转换规则和两个数相加时所采用的规则是一致的?br />
Ҏ后的代码 template< bool > struct Assert {}; template <> struct Assert < false > ; template < bool is_first_negtive, bool is_second_negtive > struct SafeIntCmpImpl { template < typename T1, typename T2 > static int int_cmp(T1 v1, T2 v2) { if (v1 == v2) return 0 ; if (v1 < v2) return - 1 ; return 1 ; } }; template <> struct SafeIntCmpImpl < true , false > { template< typename T1, typename T2, typename T3 > static int int_cmp(T1 v1, T2 v2, T3) { return SafeIntCmpImpl < true , true > ::int_cmp(T3(v1), T3(v2)); } template < typename T1, typename T2 > static int int_cmp(T1 v1, T2 v2) { return v1 < 0 ? - 1 : int_cmp(v1, v2, T1( 0 ) + T2( 0 )); } }; template <> struct SafeIntCmpImpl < false , true > { template< typename T1, typename T2 > static int int_cmp(T1 v1, T2 v2) { return - SafeIntCmpImpl < true , false > ::int_cmp(v2, v1); } }; template < typename T1, typename T2 > int SafeIntCompare(T1 v1, T2 v2) { typedef std::numeric_limits < T1 > M1; typedef std::numeric_limits < T2 > M2; static const bool is_arg_valid = M1::is_integer & M2::is_integer; Assert < is_arg_valid > (); return SafeIntCmpImpl < M1::is_signed, M2::is_signed > ::int_cmp(v1, v2); } 但上面的写法有一个问题:如果一?short和一个unsigned charq行比较Q编译器都是转ؓintq行比较Q没有必要进行特D处理(上面的代码处理后会多一个与0的比较)。实际上Q如果两个类型都是{为有W号cdQ可以直接进行比较?/div>最l代码:
template< typename T > struct IsSigned { static const bool value = T( - 1 ) < T( 0 ); }; template < bool > struct Assert {}; template <> struct Assert < false > ; template < int > struct Type {}; typedef Type < 0 > TagNormal; typedef Type < 1 > TagFirstArgIsSigned; typedef Type < 2 > TagSecondArgIsSigned; template < typename T1, typename T2, typename T3 > int SafeIntCompare(T1 v1, T2 v2, T3, TagNormal) { if (v1 < v2) return - 1 ; if (v1 == v2) return 0 ; return 1 ; } template < typename T1, typename T2, typename T3 > int SafeIntCompare(T1 v1, T2 v2, T3 v3, TagFirstArgIsSigned) { if (v1 < 0 ) return - 1 ; return SafeIntCompare(T3(v1), T3(v2), v3, TagNormal()); } template < typename T1, typename T2, typename T3 > int SafeIntCompare(T1 v1, T2 v2, T3 v3, TagSecondArgIsSigned) { if (v2 < 0 ) return 1 ; return SafeIntCompare(T3(v1), T3(v2), v3, TagNormal()); } template < typename T1, typename T2, typename T3 > int SafeIntCompare(T1 v1, T2 v2, T3 v3) { typedef std::numeric_limits < T1 > M1; typedef std::numeric_limits < T2 > M2; typedef std::numeric_limits < T3 > M3; static const bool is_arg_valid = M1::is_integer & M2::is_integer; Assert < is_arg_valid > (); static const int type_idx = M3::is_signed ? 0 : (M1::is_signed + M2::is_signed * 2 ) % 3 ; return SafeIntCompare(v1, v2, v3, Type < type_idx > ()); } template < typename T1, typename T2 > int SafeIntCompare(T1 v1, T2 v2) { return SafeIntCompare(v1, v2, T1( 0 ) + T2( 0 )); }
]]>
面试题精?目录 http://www.shnenglu.com/flyinghearts/archive/2012/03/18/168270.htmlflyinghearts flyinghearts Sun, 18 Mar 2012 14:24:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/03/18/168270.html http://www.shnenglu.com/flyinghearts/comments/168270.html http://www.shnenglu.com/flyinghearts/archive/2012/03/18/168270.html#Feedback 0 http://www.shnenglu.com/flyinghearts/comments/commentRss/168270.html http://www.shnenglu.com/flyinghearts/services/trackbacks/168270.html ?nbsp; ?/div>
1 求二叉树中相距最q的两个节点之间的距?br /> 2 判断二叉树是否^衡二叉树
3 指定二叉树,l定两节Ҏ其最q共同父节点
4 二叉树的q度遍历、逐层打印二叉树节Ҏ据、只打印某层节点数据
5 在二叉树中找出和Q叶子到根节点\径上的所有节点的数据和)为指定值的所有\径?br /> 6 二叉查找树转ؓ有序的双链表
7 求二叉树的镜?br /> 8 二叉树前序、中序、后序遍历的非递归实现
9 求二叉树高度的非递归实现
10 q接二叉树同一层上的结?/div>
1 在一个字W串中找到第一个只出现一ơ的字符Q如输入abacQ则输出b?br /> 2 输出字符串的所有组合,?abc"输出a、b、c、ab、ac、bc、abc?br /> 3 Ҏ条g扑և两个数?br /> ① 数组中,除了两个数字出现奇数ơ外Q其它数字都出现偶数ơ,扑ևq两个数字: ② 长度为n的数l,由数?到nl成Q其中数字a不出玎ͼ数字b出现两次Q其它的数字恰好出现一ơ?br /> 在不修改原数l的情况下,扑և数字a和数字b?br /> 4 求数l(或环状数l)的最大连l(或不q箋Q子序列和?br />
]]>
面试题精解之二: 字符丌Ӏ数l(1Q?/title> http://www.shnenglu.com/flyinghearts/archive/2012/03/18/168269.htmlflyinghearts flyinghearts Sun, 18 Mar 2012 13:28:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/03/18/168269.html http://www.shnenglu.com/flyinghearts/comments/168269.html http://www.shnenglu.com/flyinghearts/archive/2012/03/18/168269.html#Feedback 2 http://www.shnenglu.com/flyinghearts/comments/commentRss/168269.html http://www.shnenglu.com/flyinghearts/services/trackbacks/168269.html 阅读全文 ]]> 避免计算q程中出现溢出的一个技?/title> http://www.shnenglu.com/flyinghearts/archive/2012/03/18/168267.htmlflyinghearts flyinghearts Sun, 18 Mar 2012 13:16:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/03/18/168267.html http://www.shnenglu.com/flyinghearts/comments/168267.html http://www.shnenglu.com/flyinghearts/archive/2012/03/18/168267.html#Feedback 1 http://www.shnenglu.com/flyinghearts/comments/commentRss/168267.html http://www.shnenglu.com/flyinghearts/services/trackbacks/168267.html
先看一道面试题Q?/span>
长度?/span> n 的数l,由数?/span> 1 ?/span> n l成Q其中数?/span> a 不出玎ͼ数字 b 出现两次Q其它的数字恰好出现一ơ。怎样通过只读遍历一ơ数l,扑և数字 a ?/span> b ?/span>
׃只能遍历一ơ,在遍历数l?/span>arrӞ出 a?/span>b的差|以及 a?/span>b的^方差Q通过解方E,卛_求得 a?/span>b。具体做法ؓQ?/span>
设:
s1 = 1 + 2 + ... + n (= n * (n + 1) / 2)
s2 = arr[0] + arr[1] + ... + arr[n - 1]
r1 = 1 + 4 + ... + n^2 (= n * (n + 1) * (2 * n + 1) / 6)
r2 = arr[0]^2 + arr[1]^2 + ... + arr[n - 1]^2
c = a - b = s1 - s2
d = a^2 - b^2 = r1 - r2
昄Q?/span> a + b = (r1 - r2) / (s1 - s2)
Ҏ a+b的值和 a-b的|很容易就可算?/span>a?/span>b?/span>
法虽然单,但实现v来,却有一个很大问题:计算 s1?/span>s2?/span>r1?/span>r2q?/span>4个数Ӟ计算q程中可能出现溢出,造成l果不准。由于最l目的是Z计算?/span>c?/span>dQ一个改q的Ҏ是:
c = s1 - s2 = (1 - arr[0]) + (2 - arr[1]) + ... + (n - arr[n - 1])
d = (1 - arr[0]^2) + (4 - arr[1]^2) + ... + (n^2 - arr[n - 1]^2)
但这L做法Qƈ不能解决问题Q?/span>nE微大点Q照样存在溢出问题?/span>
那么怎样才能避免计算溢出呢?{案很简单,用模q算Q?/span> 每进行一ơ加减运时Q都取结果ؓ原结果除以一个够大的常?/span>M的余数。这样加减运中Q就不会现现溢出问题。最后再?/span> c % M?/span>d % MQ推出 c?/span>d的具体倹{比如说Q计?/span>s2改ؓ计算Q?/span>
s2 % M = ((((arr[0] % M) + arr[1]) % M + ...) % M + arr[n - 1]) %M
从表面上看,采用模运后Q计量会增加很多。但实际上,?/span>M取合适的值时Q计量q不会增加!Q?/span>
先回下计算机基本知识:两个?/span>N位(寄存器ؓ N位)的二q制无符h?/span>a?/span>b相加Q若l果溢出了, CPU会怎么处理Q当然是溢出的那一位忽略掉Q可能还要设|下溢出标志Q,得到的结果实际上是: (a + b) mod 2^N?strong>无符h间的术q算Q本质上是模运?/span>。现在的 CPU?strong>采用二补数来表示负整敎ͼ本质上也是运用模q算 Q教U书二补数表示的负整数单定义ؓQ对正整数取反后?/span>1Q,q与无符h间的q算是一致的Q在实现上,比用其它ҎQ比如说一补数Q表C整数Q要优美易实现?/span>
?/span>32位^CQ?/span> -x mod 2^32 = 2^32 – x (x > 0) Q?/span>
因?/span>-1的二q制表示是Q?/span>0xFFFFFFFF
了解了这些,׃会奇?/span>C/C++标准的规定:无符h间的q算是模q算不会溢出Q有W号数{为无W数Q采用模q算后的倹{(Z兼容没采用二补数的机器,无符h转ؓ有符hӞ若无W号数的数DZ有符h可表C的范围Q结果是q_相关的。)
因而,在对 32?/span>CPUq_Q可以先有W号数{为无W号敎ͼ再取 M = 2 ^32。需要特别注意的是,应该采用多少位的无符h保存计算中用到的数|如何避免模运可能带来的问题Q?/span>
① 无符hcd的选择Q?/span>
a?/span>b的取D围ؓQ?/span>[1, n]Q?/span>
c % M = (a - b) % M 的取D围ؓQ?/span>[1, n] (a > b?/span>)Q?/span> [M - n, M - 1] (a < b ?/span>)
q两个范围不能重叠,而因 n < M - n ?/span> 2 * n < M
?/span> M?/span>2^32的话Q且 n < 2^31 Q?/span> 可以采用 32位无W号数表C?/span>c的倹{?/span>
Ҏ c % M值在哪一个范_可以定 a > bq是 a < bQ?/span>
׃q算q程中都是采用无W号数计,?/span> a < bӞ必须q行如下调整Q?/span>
c % M 调整?/span> (-c) % M
d % M 调整?/span> (-d) % M
q样才能保证l果的正性?/span>
② 用公式计所有数字的和、^方和Ӟ可能出现的问题:
模运满I (a * b) % M = ((a % M) * (b % M)) % M
?strong>不满?/strong>Q?/span> (a / b) % M = ((a % M) / (b % M)) % M
在计?/span> (n * (n + 1) / 2) % MӞ 不能写成Q?/span>
s = ((n * (n + 1)) % M / 2) % M Q?/span>
而应该写成:
if (n % 2 == 0) s = ((n / 2) * (n + 1)) % M
else s = (((n + 1) / 2) * n) % M
或者: s = (INT((n + 1) / 2) * (n + (n + 1) % 2)) % M Q其?/span>INT(x)为取数 x的整数部份)?/span>
完整代码Q?/span>
#include < climits > #include < cassert > #define SMALL_ARRAY 0 struct Pair { int zero; int twice; }; // 32位CPUq_Q长度n一定小?^16ơ方Ӟ表示一个数的^方|可用32位无W号数类型,效率很高?br /> // 长度n若在[2^16, 2^31]区间Q就必须用到64位无W号数类型,效率较高?br /> // 长度n若在[2^31, 2^32)Ӟ表示 所有数的和sumQ就必须改用64位无W号数类型,效率不高?nbsp; Pair find_number( const int arr[], unsigned len) { const unsigned bits = CHAR_BIT * sizeof (unsigned); #if SMALL_ARRAY const unsigned max_len = 1u << (bits / 2u ); typedef unsigned int uint ; #else const unsigned max_len = 1u << (bits - 1 ); typedef unsigned long long uint ; #endif assert(arr && len >= 2 && len < max_len); const unsigned * const data = ( const unsigned * )arr; unsigned sum = 0 ; uint square_sum = 0 ; for (unsigned i = 0 ; i < len; ++ i) { const unsigned value = data[i]; sum += value; square_sum += ( uint )value * value; // 注意两个数的乘积是否会溢?nbsp; } // 1 + 2 + 3 + + len = len * (len + 1) / 2 const uint sum_all = (len + 1 ) / 2u * ( uint )(len + (len + 1 ) % 2u ); // 1^2 + 2^2 + 3^2 + + len^2 = len * (len + 1) * (2 * len + 1) / 6 const unsigned len2 = 2u * len + 1 ; const uint square_sum_all = len2 % 3u == 0 ? len2 / 3u * sum_all : sum_all / 3u * len2; unsigned difference = (unsigned)sum_all - sum; uint square_difference = square_sum_all - square_sum; const bool is_negative = difference > INT_MAX; if (is_negative) { difference = - difference; square_difference = - square_difference; } assert(difference != 0 && square_difference % difference == 0 ); const unsigned sum_two = square_difference / difference; assert((sum_two + difference) % 2u == 0 ); const unsigned larger = (sum_two + difference) / 2u ; const unsigned smaller = (sum_two - difference) / 2u ; if (is_negative) { const Pair result = { smaller, larger}; return result; } const Pair result = { larger, smaller}; return result; } int main() { } ]]> Fibonacci数计中的两个思维盲点及其扩展数列的通用高效解法 http://www.shnenglu.com/flyinghearts/archive/2012/02/28/166717.htmlflyinghearts flyinghearts Tue, 28 Feb 2012 14:14:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/02/28/166717.html http://www.shnenglu.com/flyinghearts/comments/166717.html http://www.shnenglu.com/flyinghearts/archive/2012/02/28/166717.html#Feedback 11 http://www.shnenglu.com/flyinghearts/comments/commentRss/166717.html http://www.shnenglu.com/flyinghearts/services/trackbacks/166717.html 阅读全文 ]]> 面试题精解之一Q?二叉?/title> http://www.shnenglu.com/flyinghearts/archive/2012/02/28/166713.htmlflyinghearts flyinghearts Tue, 28 Feb 2012 12:54:00 GMT http://www.shnenglu.com/flyinghearts/archive/2012/02/28/166713.html http://www.shnenglu.com/flyinghearts/comments/166713.html http://www.shnenglu.com/flyinghearts/archive/2012/02/28/166713.html#Feedback 3 http://www.shnenglu.com/flyinghearts/comments/commentRss/166713.html http://www.shnenglu.com/flyinghearts/services/trackbacks/166713.html 阅读全文 ]]> 喝汽水问?/title> http://www.shnenglu.com/flyinghearts/archive/2011/09/23/156635.htmlflyinghearts flyinghearts Fri, 23 Sep 2011 11:45:00 GMT http://www.shnenglu.com/flyinghearts/archive/2011/09/23/156635.html http://www.shnenglu.com/flyinghearts/comments/156635.html http://www.shnenglu.com/flyinghearts/archive/2011/09/23/156635.html#Feedback 7 http://www.shnenglu.com/flyinghearts/comments/commentRss/156635.html http://www.shnenglu.com/flyinghearts/services/trackbacks/156635.html 喝汽水问?/span>
by flyinghearts
?/span> 1000 瓶汽_喝完后每 3 个空瓶能?/span> 1 瓶汽_问最后最多可以喝几瓶汽水Q此时剩余几个空Ӟ
不妨假设Q共?/span>n 瓶汽_?/span>a 个空瓶能?/span>b 瓶汽_ a > bQ?/span> 刚开始有 n瓶汽_喝完后就?/span>n个空Ӟ多喝的汽水是靠空瓶换来的Q?strong>每进行一ơ空瓶换汽水Q就能多?/span> b 瓶汽水、空瓶数目就减少?/span>a-b ?/span> Q?/span>a个空瓶换?/span>b瓶汽_喝完后得?/span>b个空Ӟ?/span>
(下面?/strong> [x] 表示 x的整数部?/span> )
1 如果允许从别处(老板或其他顾客处Q借空Ӟ当然Q有借有q)
I瓶换汽水次敎ͼ [n / (a - b)]
最后剩余空Ӟ n % (a - b)
d可以喝到汽水Q?/span> n + [n / (a - b)] * b
2 不允许借空?/span>
I瓶换汽水过E中Q?strong>一但空瓶数于 a Q则停止交换?/span>
?/span> n < aQ显ӞI瓶换汽水次Cؓ 0Qd可以喝到汽水 nӞ最后剩余空?/span>n?/span>
?/span> n >= aQ(下面提供三种解法Q?/span>
解法一 I瓶换汽水次?/span>k{于满 n – (a-b)*t < a的最非负整?/span>t:
t > (n-a)/(a-b)Q最的 t?/span> [(n-a)/(a-b)] + 1 = [(n-b)/(a-b)]
剩余的空瓶数Q?/span>n – (a-b)*t
= n – (a-b)*([(n-b)/(a-b)])
= b + (n-b) - (a-b)*([(n-b)/(a-b)])
= b + (n-b)%(a-b)
解法?/span> 先预?/span>a个空Ӟ剩余的 n-a个空瓶进行换汽水Q换的过E中Q若I瓶不够 a个,则从预留?/span>a个空瓶中“?#8221;Q因而,
I瓶换汽水次敎ͼ [(n-a)/(a-b)] + 1 = [(n-b)/(a-b)]Q预留的 a个空瓶也能换一ơ)
最后剩余空Ӟ (n-b) % (a-b) + bQ预留的 a个空瓶换?/span>b瓶汽_
解法?/span> 最后一ơ空瓶换汽水得到?/span>b瓶汽_喝完后得?/span>b个空Ӟ因而最后剩余空瓶数必然大于 b个,先预?/span>b个空Ӟ剩余的 n-b个空瓶进行换汽水Q若I瓶不够 a个,则从预留?/span>b个空瓶中“?#8221;Q由于能q行I瓶换汽_I瓶?/span>>= a – bQ因?#8220;?#8221;完后Q可以保证空瓶数大等?/span>aQ,
I瓶换汽水次敎ͼ [(n-b)/(a-b)]Q?/span>
最l剩余空瓶数Q?/span>b + (n-b) % (a-b)
Q对解法三, n>=b时结论成立,对解法一、二Q可以验?/span>n >=bӞl论也成立)
因而,?/span> n >= b
I瓶换汽水次敎ͼ [(n-b)/(a-b)]
最后剩余空Ӟ b + (n-b) % (a-b)
d可以喝到汽水Q?/span> n + [(n-b)/(a-b)] * b
对原题:
n = 1000 Q?/span>a = 3, b = 1Q?/span> a – b = 2
若允许借空?/span>
可以喝到汽水Q?/span> 1000 + 1000 / 2 = 1500
剩余I瓶Q?/span>1000 % 2 = 0
若不允许借空?/span>
可以喝到汽水Q?/span> 1000 + (1000 - 1) / 2 = 1499Q?/span>
剩余I瓶Q?/span> 1 + (1000 - 1) % 2 = 2
]]> 三国?剧本修改?1.1 http://www.shnenglu.com/flyinghearts/archive/2011/08/07/152739.htmlflyinghearts flyinghearts Sun, 07 Aug 2011 15:24:00 GMT http://www.shnenglu.com/flyinghearts/archive/2011/08/07/152739.html http://www.shnenglu.com/flyinghearts/comments/152739.html http://www.shnenglu.com/flyinghearts/archive/2011/08/07/152739.html#Feedback 1 http://www.shnenglu.com/flyinghearts/comments/commentRss/152739.html http://www.shnenglu.com/flyinghearts/services/trackbacks/152739.html l以前写的剧本修改器Q加了个界面Q本想用wtlQ但是代码中用到不少“初始化列?#8221;{c++11新特性,只好让VC2010靠边站了。对mingwQ好用的gui库还真没有,x十几个消息Q干脆直接调用windows api得了?br /> ]]> 对环状数l求q箋子数l的最大和 http://www.shnenglu.com/flyinghearts/archive/2011/07/20/151513.htmlflyinghearts flyinghearts Wed, 20 Jul 2011 15:49:00 GMT http://www.shnenglu.com/flyinghearts/archive/2011/07/20/151513.html http://www.shnenglu.com/flyinghearts/comments/151513.html http://www.shnenglu.com/flyinghearts/archive/2011/07/20/151513.html#Feedback 2 http://www.shnenglu.com/flyinghearts/comments/commentRss/151513.html http://www.shnenglu.com/flyinghearts/services/trackbacks/151513.html
思\Q由于数l元素d是固定|因而跨头、尾的连l子数组和最大,{h于求 中间那段和最。因此,问题转ؓ计算 q箋子数l的最大和 ?q箋子数l的最和
import std . algorithm ;
int ring_max_continue_sum ( in int [] src )
{
int min_sum = src [ 0 ], cur_min_sum = min_sum ;
int max_sum = src [ 0 ], cur_max_sum = max_sum ;
int total_sum = src [ 0 ];
foreach ( value ; src [ 1 .. $ ]) {
cur_min_sum = min ( value , cur_min_sum + value );
min_sum = min ( min_sum , cur_min_sum );
cur_max_sum = max ( value , cur_max_sum + value );
max_sum = max ( max_sum , cur_max_sum );
total_sum += value ;
}
return max ( max_sum , total_sum - min_sum );
}
unittest {
auto ta = [ 3 , - 2 , 3 ];
auto tb = [ 3 , 4 , - 2 , 3 , - 7 , 1 , - 3 , 8 ];
assert ( ta . ring_max_continue_sum == 6 );
assert ( tb . ring_max_continue_sum == 16 );
}
void main ()
{
}
]]>最短摘要的生成Q补充) http://www.shnenglu.com/flyinghearts/archive/2011/07/20/151511.htmlflyinghearts flyinghearts Wed, 20 Jul 2011 15:39:00 GMT http://www.shnenglu.com/flyinghearts/archive/2011/07/20/151511.html http://www.shnenglu.com/flyinghearts/comments/151511.html http://www.shnenglu.com/flyinghearts/archive/2011/07/20/151511.html#Feedback 0 http://www.shnenglu.com/flyinghearts/comments/commentRss/151511.html http://www.shnenglu.com/flyinghearts/services/trackbacks/151511.html 阅读全文 ]]> Fibonacci数列的两UO(lgn)解法 http://www.shnenglu.com/flyinghearts/archive/2011/07/20/151510.htmlflyinghearts flyinghearts Wed, 20 Jul 2011 15:30:00 GMT http://www.shnenglu.com/flyinghearts/archive/2011/07/20/151510.html http://www.shnenglu.com/flyinghearts/comments/151510.html http://www.shnenglu.com/flyinghearts/archive/2011/07/20/151510.html#Feedback 0 http://www.shnenglu.com/flyinghearts/comments/commentRss/151510.html http://www.shnenglu.com/flyinghearts/services/trackbacks/151510.html import std . stdio : writef ;
uint fib_matrix ( uint num ) // 矩阵法求fibonacci?/span>
{
if ( num <= 1 ) return num ;
-- num ;
uint ret = 1 , next = 1 ;
for ( uint a = 1 , b = 0 ; num != 0 ; num >>= 1 ) {
if ( num & 1 ) {
auto tmp = next ;
next = ( a + b ) * next + a * ret ;
ret = a * tmp + b * ret ;
}
auto tmp = a ;
a = a * ( a + 2 * b );
b = b * b + tmp * tmp ;
}
return ret ;
}
uint fib ( uint num )
{
if ( num <= 1 ) return num ;
uint left_most_one = num ; // 等于num的最?的kơ幂
for ( uint value = num ; value &= ( value - 1 ); ) left_most_one = value ;
uint ret = 1 , next = 1 ;
while ( left_most_one >>= 1 ) {
if ( num & left_most_one ) {
auto tmp = ret ;
ret = ret * ret + next * next ;
next = ( tmp * 2 + next ) * next ;
} else {
auto tmp = ret ;
ret = ( next * 2 - ret ) * ret ;
next = tmp * tmp + next * next ;
}
}
return ret ;
}
uint fib_basic ( uint num )
{
if ( num <= 1 ) return num ;
uint prev = 0 , current = 1 ;
for ( uint i = 2 ; i <= num ; ++ i ) {
auto tmp = prev ;
prev = current ;
current += tmp ;
}
return current ;
}
unittest {
foreach ( i ; 0 .. 48 ) {
auto a = fib_basic ( i ), b = fib_matrix ( i ), c = fib ( i );
if ( a != b || a != c )
writef( "%s %s %s %s\n" , i , a , b , c );
}
}
void main ()
{
}
]]> VC 2010 error D8027Q无法执行c1xx.dll的解x?/title> http://www.shnenglu.com/flyinghearts/archive/2011/07/19/151417.htmlflyinghearts flyinghearts Tue, 19 Jul 2011 14:07:00 GMT http://www.shnenglu.com/flyinghearts/archive/2011/07/19/151417.html http://www.shnenglu.com/flyinghearts/comments/151417.html http://www.shnenglu.com/flyinghearts/archive/2011/07/19/151417.html#Feedback 2 http://www.shnenglu.com/flyinghearts/comments/commentRss/151417.html http://www.shnenglu.com/flyinghearts/services/trackbacks/151417.html 晚上惌个程序,l果VC 2010头一ơŞ工:
cl: 命o?error D8027 :无法执行“E:\prog\vc2010\bin\c1xx.dll”
上网搜烦了下Q也没找C个解x法(
官方说明 Q。正郁闷着Q突焉惛_cl.exe可以正常q行Q而c1xx.dll不能正常q行Q会不会是c1xx.dll的依赖库出问题了Q于是调出dependency一查,果然了个msvcp100.dllQ估计是某个卸蝲软g造成的)Q从别处拯一个到bin目录Q问题解冟?br />
]]>
ŷƷž99þڹۿ |
þþɫۺϾɫ99 |
þøŮ߳MBA |
ƷŮٸAVѾþ |
ձŷþþþѲ
|
AVһȾþ |
רþۺϾĻ |
˸ŮѲžþþ |
þþþþྫƷֱ |
þAV뾫Ʒ |
һֻƴƬ99þ |
þþþþѹۿ |
Ʒþþþþ |
AvƷþ |
žžƷ99þþ㽶 |
?Vþò |
þþþƷ |
91Ըߺþþþ |
þþƷԴվ |
ƷŮþþ |
þþƷavӰԺ |
þֻƷ99re66 |
þþƷ72 |
ƷþþþùA |
þþþþþ91Ʒѹۿ |
þҹӰ |
ɫþþ99Ʒ |
ۺϾþþƷɫ |
ӰһѾþþþþþþ
|
վþþ |
鶹avþavʢav |
þþþù |
þ99Ʒ鶹 |
þù¶ƷӰ |
þƷƷ |
պһþ99 |
ձƷþþĻ |
Сڵþþþþ |
ҹҹþݺ |
þþþƷ˵ |
ھƷþþþþҰ |