/**
* @author Midnight_Pops 2015/10/24(六) Java入門及簡介_陳耿豪老師
*/
package helloworld;
public class HelloWorld {
public static void main(String[] args) {
String firstname = "Pei Hung";
String lastname = " Sung";
System.out.println(firstname+lastname);
float PI_1 = 3.14f;
double PI_2 = 3.14;
java.util.Scanner s1 = new java.util.Scanner(System.in);
java.util.Scanner s2 = new java.util.Scanner(System.in);
//System.out.println("我愛大咪咪");
//System.out.println("PI_1 = "+PI_1);
//System.out.println("PI_2 = "+PI_2);
// System.out.println("");
System.out.println("輸入2個隨意數字,將顯示兩數的5種運算『+-*/%』結果為多少。");
System.out.println("請輸入第一個數字");
int a = s1.nextInt();
System.out.println("請輸入第二個數字");
int b = s2.nextInt();
//double c0 = ((double)a*(double)b);
double c = ((double)a/(double)b);
double d = ((double)a%(double)b);
System.out.println("");
System.out.println("結果如下:");
System.out.println(a+"+"+b+" = "+(a+b));
System.out.println(a+"-"+b+" = "+(a-b));
System.out.println(a+"*"+b+" = "+(a*b));
System.out.println(a+"/"+b+" = "+(c));
System.out.println(a+"%"+b+" = "+(d));
int e = a;
int f = b;
int i = 0;
int g = a;
int h = b;
i = e++ + ++f;
//e = f++;
//g = ++h;
//System.out.println("c = b++ => "+"a = "+e+", b = "+f);
// System.out.println("c = ++b => "+"a = "+g+", b = "+h
System.out.println("c = a++ + ++b => "+"a = "+e+", b = "+f+", c = "+i);
}
}