数字运算,判断一个数是否接近素数 A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no
上传时间: 2015-05-21
上传用户:daguda
人民币大写金额转换程序(修正版v0.0.3) =================================== 1.使用方法: ------------- 将Cash_RMB.dcu放入Delphi安装目录下的Lib中,在uses中加入Cash_RMB, 即可引用CashRMB方法. function CashRMB(CashAmount: Double): String 如: procedure TForm1.Button1Click(Sender: TObject) begin QRLabel1.Caption := CashRMB(Table1.FieldByName( 金额 ).AsFloat) end 结果将传回人民币金额大写字符串. 如果 CashAmount = 0 或数值溢出(超出万亿位),结果返回空串. 2.说明: -------- A.本转换程序最大程度只支持到万亿元(位)的金额数值转换操作.如果你的 转换数值超出此极限,你可以在调用前先行判断数据的合法性,如果没有作预 先判断,转换过程中将引发本单元中自带的错误处理例程. b.该转换结果符合标准金额大写书写格式,零角零分等字样不存在于最终的 转换结果中. c.本转换程序自带数据溢出等数据非法及转换错误等处理例程. d.本程序适用于32位的Delphi版本.
上传时间: 2013-12-31
上传用户:hebmuljb
An example to illustrate how to set the internal adjustable CID gain and receive FSK or DTMF data. Assume end-code of DTMF data string is "D".
标签: adjustable illustrate internal example
上传时间: 2015-07-05
上传用户:nairui21
定义一个字符串类String,其私有成员为一个字符串指针。设计构造函数,拷贝构造函数,析构函数,设置新值函数Set, 打印成员值函数Print。借助此String类,将操作符"=="、">"、"<"的重载函数设置为String类的成员函数,实现对操作符"=="、">"、"<"的重载,使之能直接比较两个String类类型的字符串的大小,设计各种情况调用此三个重载操作符。
上传时间: 2013-12-26
上传用户:youth25
加密算法 Test Driver for Crypto++, a C++ Class Library of Cryptographic Primitives: - To generate an RSA key cryptest g - To encrypt and decrypt a string using RSA cryptest r - To calculate MD5, SHS, and RIPEMD-160 message digests: cryptest m file - To encrypt and decrypt a string using DES-EDE in CBC mode: cryptest t - To encrypt or decrypt a file cryptest e|d input output - To share a file into shadows: cryptest s <pieces> <pieces-needed> file (make sure file has no extension, if you re running this under DOS) - To reconstruct a file from shadows: cryptest j output file1 file2 [....] - To gzip a file: cryptest z <compression-level> input output - To gunzip a file: cryptest u input output - To run validation tests: cryptest v - To run benchmarks: cryptest b [time for each benchmark in seconds]
标签: Cryptographic Primitives generate Library
上传时间: 2015-07-16
上传用户:wqxstar
问题描述:编写一个JAVA程序,用面向对象设计的方法编写一个电话卡的类。包括卡号、密码、余额、拨入号码等 b)基本要求:类的属性有卡号、密码、余额、拨入号码,电话卡的常用操作可以用连接电话方法、返回余额方法与通电话方法来实现。 c)方法功能描述: 构造方法(PhoneCard(卡号,密码,余额,拨入号码))可以完成属性值初始化赋值,并判断余额,余额为负就退出系统,请在构造方法中将初始时的连接置为false即表示没有连接。 卡号long cardNumber 密码private int password,余额double balance,拨入号码string connectNumber boolean connected(一个布尔类型变量表示电话卡连接状态,初始时默认没有连接,值为false,当调用连接电话方法()后,在判断卡号和密码相匹配后值置为true) 连接电话方法(performConnection(卡号,密码))可以完成检查卡号和密码,它是只有在卡号和密码相匹配时才连接 返回余额方法(getBalance())得到电话卡的余额 通电话方法(performDial())是模拟通过过程中,余额会不断减少,每调用此方法,电话卡的余额减少0。5元,打一次电话调用一次
上传时间: 2014-01-20
上传用户:1109003457
Unicode String 操作,Set, Append, Copy, GetLen, GetBuff, and so on
上传时间: 2013-12-13
上传用户:Divine
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa. For example, >> project.name = MyProject >> project.id = 1234 >> project.param.a = 3.1415 >> project.param.b = 42 becomes with str=xml_format(project, off ) "<project> <name>MyProject</name> <id>1234</id> <param> <a>3.1415</a> <b>42</b> </param> </project>" On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
标签: converts Toolbox complex logical
上传时间: 2016-02-12
上传用户:a673761058
This string-include defines all string functions as inline functions. Use gcc. It also assumes ds=es=data space, this should be normal. Most of the string-functions are rather heavily hand-optimized, see especially strtok,strstr,str[c]spn. They should work, but are not very easy to understand. Everything is done entirely within the register set, making the functions fast and clean.
标签: functions string-include defines assumes
上传时间: 2014-01-09
上传用户:tedo811
Atheros无线芯片AR-6000系列wince 6驱动源代码(这东西我也没用过别问我,我是搜别的wince资源搜到的) AR6K SDIO support. Requires firmware 1.1 on SD13 cards. readme: Atheros Communications AR6001 WLAN Driver for SDIO installation Read Me March 26,2007 (based on k14 fw1.1) Windows CE Embedded CE 6.0 driver installation. 1. Unzip the installation file onto your system (called installation directory below) 2. Create an OS design or open an existing OS design in Platform Builder 6.0. a. The OS must support the SD bus driver and have an SD Host Controller driver (add these from Catalog Items). b. Run image size should be set to allow greater than 32MB. 3. a. From the Project menu select Add Existing Subproject... b. select AR6K_DRV.pbxml c. select open This should create a subproject within your OS Design project for the AR6K_DRV driver. 4. Build the solution. 转自Tony嵌入式,原文地址:http://www.cevx.com/bbs/dispbbs.asp?boardID=4&ID=11762&page=1
标签: wince Requires firmware Atheros
上传时间: 2014-11-11
上传用户:bibirnovis