回複:計算機程序題

來源: 2007-12-22 12:59:51 [舊帖] [給我悄悄話] 本文已被閱讀:

int n, nplus1;
int x = 0X1;

if( n % 2 == 0 ) nplus1 = n | x;
else nplus1 = 2 * (int)ceil((double)n/2.0);