matlab例程MATLAB 6.x版的內(nèi)建數(shù)據(jù)類(lèi)型(Built-in data type)就有5種以上,此外還有許多其他專(zhuān)門(mén)設(shè)計(jì)的類(lèi)(Class),如符號(hào)類(lèi)、內(nèi)聯(lián)函數(shù)類(lèi)、控制工具包中的線(xiàn)性時(shí)不變模型類(lèi)、神經(jīng)網(wǎng)絡(luò)類(lèi)等。就程序設(shè)計(jì)而言,MATLAB 6.x版采用了面向?qū)ο缶幊碳夹g(shù)。數(shù)據(jù)和編程的改變使用戶(hù)能更簡(jiǎn)捷而自然地解決復(fù)雜的計(jì)算問(wèn)題(如符號(hào)計(jì)算問(wèn)題、多變量控制系統(tǒng)問(wèn)題、神經(jīng)網(wǎng)絡(luò)問(wèn)題)。本章內(nèi)容根據(jù)MATLAB6.5編寫(xiě),但絕大部分內(nèi)容適用于其他MATLAB6.x版本。
ACM試題An Easy Problem
Description
As we known, data stored in the computers is in binary form. The problem we discuss now is about the positive integers and its binary form. Given a positive integer I, you task is to find out an integer J, which is the minimum integer greater than I, and the number of 1 s in whose binary form is the same as that in the binary form of I. For example, if "78" is given, we can write out its binary form, "1001110". This binary form has 4 1 s. The minimum integer, which is greater than "1001110" and also contains 4 1 s, is "1010011", i.e. "83", so you should output "83".