關於什麼是Hammiong Code(漢明碼)
是一種資料傳輸過程中的Error Correcting
Lillian 發表在 痞客邦 留言(0) 人氣(7)
快速排序法說明:1.設定一個指標數
Lillian 發表在 痞客邦 留言(0) 人氣(1)
為了計算看完課程要花多少時間做的
import java.util.Scanner;
public class MainClass {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int second = 0;
int minute = 0;
while (true) {
System.out.println("輸入分:");
int inM = sc.nextInt();
if (inM == -1) {
break;
}
minute += inM;
System.out.println("輸入秒:");
int inS = sc.nextInt();
minute += inS / 60;
second += inS % 60;
}
int hour = minute / 60;
minute += second/60;
minute %= 60;
System.out.println(hour + "小時" + minute + "分");
}
}
Lillian 發表在 痞客邦 留言(0) 人氣(0)

按照課本「白話演算法」第四章的遞迴練習
練習一下遞迴的使用,有些程式語言編寫的邏輯都是使用遞迴,反而沒有迴圈的概念,例如(Haskell)
Lillian 發表在 痞客邦 留言(0) 人氣(13)
Lillian 發表在 痞客邦 留言(0) 人氣(2)
第一版 笨笨方法,我還沒有理解到【字串】就是【字元】的陣列....
Lillian 發表在 痞客邦 留言(0) 人氣(610)

判斷數字是否輸入過-使用陣列
先樹入數值,再判斷是否曾長陣列,以免浪費空間
Lillian 發表在 痞客邦 留言(0) 人氣(12)

半路轉職想成為工程師的我,真的很害怕學的東西只是皮毛,根本沒辦法上職場。
在網路上常常看到培訓班出來的人,面試被洗臉....
Lillian 發表在 痞客邦 留言(0) 人氣(16)

課本4-18頁的while例題-平均分數計算,總覺得說明有點奇怪,於是自己做了一張流程圖...嗯,說明真的很奇怪。
import java.util.Scanner;
public class MainClass {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int score = 0; //分數
int sum = 0; //總分
int cnt= -1; //人數
while(score != -1){
cnt++; //第一次跑迴圈人數會加一,因此cnt初始值要設成-1
sum += score;
System.out.print("輸入分數(-1結束):" );
score = scanner.nextInt();
}
System.out.println("學生人數:" + cnt + "\t總分"+ sum + "\t平均分數" + (double)sum/cnt + "\t" + score) ;
}
}
Lillian 發表在 痞客邦 留言(0) 人氣(52)

import java.util.Scanner;
public class MainClass {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int x = 1;
int y = 1;
int ans = 0;
while (x <10 ) {
while(y<10){
ans = x * y;
System.out.print(y + "*" + x + "=" + ans + "\t");
y++;
}
x++;
y = 1;
System.out.println();
}
}
}
Lillian 發表在 痞客邦 留言(0) 人氣(4)