This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ce1002.A7.s101522071; | |
| import java.awt.*; | |
| import java.awt.event.*; | |
| import javax.swing.*; | |
| public class A7 extends JFrame | |
| { | |
| static JFrame frm = new JFrame("小算盤"); | |
| static JPanel pnl = new JPanel(new GridLayout(3, 3)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ce1002.A4.s101522071; | |
| import java.util.Scanner; | |
| import java.util.Stack; | |
| public class A4 | |
| { | |
| private static int i = 0, j = 0; //current position | |
| private static char maze[][] = new char [15][15]; | |
| private static Stack<Integer> i_stack = new Stack<Integer>(); //save path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 3*3 矩陣 | |
| [00] [01] [02] | |
| [10] [11] [12] | |
| [20] [21] [22] | |
| // 以下括弧省略 | |
| A B A B A B C | |
| 00 * 00 + 01 * 10 + 02 * 20 = 00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ce1002.A3.s101522071; | |
| import java.util.Scanner; | |
| public class A3 | |
| { | |
| //固定矩陣B | |
| private static int array_B[][] = { | |
| {7, 5, 3}, | |
| {1, 4, 9}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ce1002.E2.s101522071; | |
| import java.util.Scanner; | |
| public class E22 | |
| { | |
| private static int[] queue = new int[100]; //my queue | |
| private static int size = 0; //queue's current size | |
| public static void push( int num ) //push value to queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ce1002.E2.s101522071; | |
| import java.util.Scanner; | |
| public class E21 | |
| { | |
| private static int[] stack = new int[100]; //my stack | |
| private static int size = 0; //stack's current size | |
| public static void push( int num ) //push value to stack |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ce1002.s101522071; | |
| import java.util.Scanner; // import Scanner class | |
| public class Q1 { | |
| public static double toFahrenheit(double input){ // define method toFahrenheit to change input from Celcius to Fahrenheit | |
| double answer = (input*9)/5 + 32; | |
| return answer; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cstdlib> | |
| #include <stdio.h> | |
| using namespace std; | |
| int main() | |
| { | |
| int a=123456; | |
| int *aPtr = &a; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cctype> | |
| #include <iostream> | |
| #include <string> | |
| using namespace std; | |
| //transform upper or lower | |
| void string_transform(string *p) //get address | |
| { | |
| ...... |