2015年1月29日 星期四

java程式設計題目---字母處理【大寫轉小寫小寫轉大寫】

Write the following method that returns a new string in which the uppercase are changed to lowercace and lowercace to uppercase.
EX: enter: aBcD ,output: AbCd。

2015年1月19日 星期一

java程式設計題目---數字處理【座標最短距離與座標】

設計一程式,提示使用者輸入座標點數,再依序輸入所有點的二為座標(x,y)。
(a)找出點之間的最短座標。
(b)找出是那些點之間的最短距離。
例如:
輸入:                                                  輸出:
輸入座標點數:3                                 最短距離:2.00
依序輸入3個座標x、y:                      那些點之間距離最短:
0  3                                                     (1,0);(3,0)
1  0
3  0


java程式設計題目---數字處理【十六進位轉二進位】

設計一程式,提示使用者輸入一16進位數字,將該16進位數字轉為對應的2進位數字。使用字元"1"或"0"每四個空一格的方式從螢幕輸出。
例如:輸入123F5,輸出:0001 0011 1111 0101。


2014年12月27日 星期六

java程式設計題目---數字處理【雙生質數(使用method)】

Twin primes(雙生質數) are a pair of prime numbers that differ by 2. For example, 3 and 5 are twin primes, 5 and 7 are twin primes, and 11 and 13 are twin primes. Write a program to find all twin primes less than 1,000. Display the output as follows:
(3,5)
(5,7)
...

java程式設計題目---公式計算【梅森質數(使用method)】

A prime number is called a Mersenne prime(梅森質數) if it can be written in the form 2^p-1 for some positive integer p.
Write a program that finds all Mersenne prime with p<=31 and displays the output as follows:
p     2^p-1
2         3
3         7
5         31
...

2014年12月26日 星期五

java程式設計題目---數字處理【迴文質數判斷(使用method)】

A palindromic prime is a prime number and also palindromic. For example, 131 is a prime and also a palindromic prime, as are 313 and 757. Write a program that displays the first 100 palindromic prime numbers. Display 10 numbers line, separated by exactly one space, as follows:
2 3 5 7 11 101 131 151 181 191
313 353 373 383 727 757  787 797 919 929

java程式設計題目---數字處理【迴文判斷(使用method)】

Write the methods with the following headers:
public static int reverse(int number)
public static Boolean isPalindrome(int number)
Use the reverse method to implement isPalindrome. A number is a palindrome if its reversal is the same as itself. Write a test program that prompts the user to enter an integer and reports whether the integer is a palindrome.

Go(Golang)程式語言 設定GCC

下載MSYS2:  https://www.msys2.org/ 安裝 程式開始執行後輸入: pacman -Syu y y 在安裝目錄底下找到msys2.exe,雙擊執行 輸入指令: pacman -Su pacman -S --needed base-devel mingw-...