在大端机器(solaris-sparc,hpux-hppa)上从奇数内存地址取一个整形(2 or 4 bytes)会崩溃.如: unsigned short Res = *(unsigned short *) tmpArray; 应该: char tmpArray[sizeof(unsigned short)] = {0}; for(int i = 0; i < sizeof(unsigned short); ++i) { tmpArray[i] = *(pcNewHdr + i); } uns
用oracle sql对数字进行操作: 取上取整.向下取整.保留N位小数.四舍五入.数字格式化 取整(向下取整): select floor(5.534) from dual; select trunc(5.534) from dual; 上面两种用法都可以对数字5.534向下取整,结果为5. 如果要向上取整 ,得到结果为6,则应该用ceil select ceil(5.534) from dual; 四舍五入: SELECT round(5.534) FROM dual; ) FROM dua
Description Tom is a commander, his task is destroying his enemy’s transportation system. Let’s represent his enemy’s transportation system as a simple directed graph G with n nodes and m edges. Each node is a city and each directed edge is a directe
Description You’ve just built a circuit board for your new robot, and now you need to power it. Your robot circuit consists of a number of electrical components that each require a certain amount of current to operate. Every component has a + and a −
Description In a country there are n cities connected by m one way roads. You can paint any of these roads. To paint a road it costs d unit of money where d is the length of that road. Your task is to paint some of the roads so that the painted roads
Description A prominent microprocessor company has enlisted your help to lay out some interchangeable components(widgets) on some of their computer chips. Each chip’s design is an N × N square of slots. Oneslot can hold a single component, and you ar
Description We are supposed to make a budget proposal for this multi-site competition. The budget proposal is a matrix where the rows represent different kinds of expenses and the columns represent different sites. We had a meeting about this, some t
Description The terrorist group leaded by a well known international terrorist Ben Bladen is buliding a nuclear reactor to produce plutonium for the nuclear bomb they are planning to create. Being the wicked computer genius of this group, you are re