數字運算,判斷一個數是否接近素數
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
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).
學生選課系統,該系統主要實現簡單的大學學生選修課程的功能。
1.系統的用戶主要分為2類:學生和管理員
2.數據描述
<1> 課程: 課程號、課程名、學分、學時、教師、開課學期、適用專業、最大選課人數
<2> 學生:學號、姓名、密碼、專業年級
<3> 學生選課情況:學號、課程號、是否已經考試、成績
<4> 管理員:編號、姓名、密碼
3.功能描述
<1> 學生功能:
a. 登錄:學生使用學號和密碼登錄。
b. 選課功能:學生能夠選擇所需要的課程。
c. 退選功能:學生能夠退選課程。
d. 選課情況查詢:查詢該學生已經選的課程(分學期)。
e. 成績查詢:查詢該學生某一門課程的成績,某學期所有課程的成績。
<2> 管理員功能
a. 登錄:
b. 管理課程:包括課程的增加、刪除、修改等。
c. 選課管理:能夠列出指定學期、課程的選課學生名單,能夠對學生的選課進行調整。
d. 成績表管理:能夠錄入學生的成績,列出指定學期、課程的成績單。
該系統主要實現簡單的大學學生選修課程的功能。 1.系統的用戶主要分為2類:學生和管理員 2.數據描述 <1> 課程: 課程號、課程名、學分、學時、教師、開課學期、適用專業、最大選課人數 <2> 學生:學號、姓名、密碼、專業年級 <3> 學生選課情況:學號、課程號、是否已經考試、成績 <4> 管理員:編號、姓名、密碼 3.功能描述 <1> 學生功能: a. 登錄:學生使用學號和密碼登錄。 b. 選課功能:學生能夠選擇所需要的課程。 c. 退選功能:學生能夠退選課程。 d. 選課情況查詢:查詢該學生已經選的課程(分學期)。 e. 成績查詢:查詢該學生某一門課程的成績,某學期所有課程的成績。 <2> 管理員功能 a. 登錄: b. 管理課程:包括課程的增加、刪除、修改等。 c. 選課管理:能夠列出指定學期、課程的選課學生名單,能夠對學生的選課進行調整。 d. 成績表管理:能夠錄入學生的成績,列出指定學期、課程的成績單。