Archive for 五月, 2012

0529EMath

4-4拉氏反變換

4-4拉氏反變換

赫維賽德展式解部份分式的係數

赫維賽德展式解部份分式的係數

例4.4.2

例4.4.2

第一移位定理求1/(S+3)^2的拉氏反變換

第一移位定理求1/(S+3)^2的拉氏反變換

微分的拉氏變換

微分的拉氏變換

以拉氏變換解微分方程式

以拉氏變換解微分方程式

例4.6.2

例4.6.2

 

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , ,

0525Prog

檔案輸出入的物件及流程控制

檔案輸出入的物件及流程控制

產生不重覆的數字

產生不重覆的數字

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , ,

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , ,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import java.io.*;
import java.util.*;
public class Ex4Class {
	static Random random = new Random();
	public static void main(String[] args) {
		String filename = args[0];
		FileWriter fileWriter;
		PrintWriter printWriter;
		try
		{
			fileWriter = new FileWriter(filename);
			printWriter = new PrintWriter(fileWriter);
			for (int i=0; i< 100; i++)
			{
				int[] numList = NumGen();
				System.out.printf("random numbers: %2d %2d %2d %2d %2d %2d", 
						numList[0],numList[1],numList[2],numList[3],numList[4],numList[5]);
				printWriter.printf("%2d %2d %2d %2d %2d %2d", 
						numList[0],numList[1],numList[2],numList[3],numList[4],numList[5]);
				System.out.println();
				printWriter.println();
			}
			printWriter.close();
		}
		catch(FileNotFoundException e)
		{
			System.out.println(e.getMessage());
		}
		catch(IOException e)
		{
			System.out.println(e.getMessage());
		}
	}
	static int[] NumGen()
	{
		int[] numList = new int[6];
		int[] ball = new int[49];
		for (int j=0; j <49; j++)
		{
			ball[j] = random.nextInt(100000);
		}
		for (int i=0; i< 6; i++)
		{
			int max= -1;
			int select = -1;
			for (int j=0; j <49; j++)
			{
				if (ball[j] > max)
				{
					max = ball[j];
					select = j;
				}
			}
			numList[i] = select + 1;
			ball[select] = -1;
		}
		return numList;
	}
}

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , , ,

0518Prog

Java 檔案讀寫的物件

Java 檔案讀寫的物件

字串處理: split()以及trim()

字串處理: split()以及trim()

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , ,