1. 下列說法正確的是 ( )
A. Java語言不區(qū)分大小寫
B. Java程序以類為基本單位
C. JVM為Java虛擬機(jī)JVM的英文縮寫
D. 運(yùn)行Java程序需要先安裝JDK
2. 下列說法中錯(cuò)誤的是 ( )
A. Java語言是編譯執(zhí)行的
B. Java中使用了多進(jìn)程技術(shù)
C. Java的單行注視以//開頭
D. Java語言具有很高的安全性
3. 下面不屬于Java語言特點(diǎn)的一項(xiàng)是( )
A. 安全性
B. 分布式
C. 移植性
D. 編譯執(zhí)行
4. 下列語句中,正確的項(xiàng)是 ( )
A . int $e,a,b=10
B. char c,d=’a’
C. float e=0.0d
D. double c=0.0f
prolog 找路例子程序:
=== === === === === ===
Part 1-Adding connections
Part 2-Simple Path
example
| ?- path1(a,b,P,T).
will produce the response:
T = 15
P = [a,b] ?
Part 3 - Non-repeating path
As an example, the query:
?- path2(a,h,P,T).
will succeed and may produce the bindings:
P = [a,depot,b,d,e,f,h]
T = 155
Part 4 - Generating a path below a cost threshold
As an example, the query:
?- path_below_cost(a,[a,b,c,d,e,f,g,h],RS,300).
returns:
RS = [a,b,depot,c,d,e,g,f,h] ?
RS = [a,c,depot,b,d,e,g,f,h] ?
no
==================================
數(shù)字運(yùn)算,判斷一個(gè)數(shù)是否接近素?cái)?shù)
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 government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d .
Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet.
Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1.
Definition
VHDL編寫的4選一數(shù)據(jù)選擇器
entity mux41a is
port(a,b:in
std_logic;
s1,s2,s3,s4:in std_logic;
y:
out std_logic);
end entity mux41a;
architecture one of mux41a is
signal ab:std_logic_vector(1 downto 0);