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月29日 星期四
2015年1月19日 星期一
java程式設計題目---數字處理【座標最短距離與座標】
設計一程式,提示使用者輸入座標點數,再依序輸入所有點的二為座標(x,y)。
(a)找出點之間的最短座標。
(b)找出是那些點之間的最短距離。
例如:
輸入: 輸出:
輸入座標點數:3 最短距離:2.00
依序輸入3個座標x、y: 那些點之間距離最短:
0 3 (1,0);(3,0)
1 0
3 0
(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。
例如:輸入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)
...
(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
...
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
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.
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.
訂閱:
文章 (Atom)
Go(Golang)程式語言 設定GCC
下載MSYS2: https://www.msys2.org/ 安裝 程式開始執行後輸入: pacman -Syu y y 在安裝目錄底下找到msys2.exe,雙擊執行 輸入指令: pacman -Su pacman -S --needed base-devel mingw-...
-
MNIST手寫數字辨識資料集 MNIST手寫數字辨識資料集 ,是由 Yann LeCun(揚·勒丘恩) 大神所蒐集,這位大神同時也是Convulution Nueral Networks(卷積神經網絡)的創始人,因此享有"卷積網絡之父"的美譽。關於這位大...
-
顯示語言 在一班情況下, Vsiual Studio Code (VSCode) 安裝完成後為英語版本,當然它也附有其他九種語言,分別是:英文(美國)、簡體中文、繁體中文、法文、德文、義大利文、日文、韓文、俄文、西班牙文。各個語言與其代碼對照如下表: Display ...
-
第一章 二、效能與效率有何區別 ? 效能 : 作對的事情 效率 : 把事情做對 五、管理程序包括哪四項管理職能 ? 規劃、組織、領導、控制 六、管理者所扮演的色有哪些 ? 人際角色 : 頭臉人物、領導者、聯絡人 資訊角色 : 監控者、傳播者、發言人...