package chap1;

import java.io.BufferedReader;
import java.io.InputStreamReader;
public class t102101 {
 public static void main(String args[]) throws Exception{
  BufferedReader br;
  br = new BufferedReader(new InputStreamReader(System.in));
  int A,B,C, sum,total;
 System.out.println("請輸入第一個值");
 A = Integer.parseInt(br.readLine());//字串 
 System.out.println("請輸入第二個值");
 B = Integer.parseInt(br.readLine());
 System.out.println("請輸入第三個值");
 C = Integer.parseInt(br.readLine());
 
 System.out.println(A+"\t"+B+"\t"+C+"\n");
 sum = A+B+C;
 System.out.println("A+B+C=" +sum);
 total=A-B+C;
 System.out.println("A-B+C=" +total);
 }
}

 

-----

 

package chap1;

import java.io.BufferedReader;
import java.io.InputStreamReader;
public class t102101 {
 public static void main(String args[]) throws Exception{
  BufferedReader br;
  br = new BufferedReader(new InputStreamReader(System.in));


  int A,B,C, sum,total,mul;
  double A2 ,P3,sqa,AB,ABC,ABC1,ABC2;


 System.out.println("請輸入第一個值");
 A = Integer.parseInt(br.readLine());//字串 
 System.out.println("請輸入第二個值");
 B = Integer.parseInt(br.readLine());
 System.out.println("請輸入第三個值");
 C = Integer.parseInt(br.readLine());
 System.out.println(A+"\t"+B+"\t"+C+"\n");
 
 sum = A+B+C;
 System.out.println("A+B+C=" +sum);
 total=A-B+C;
 System.out.println("A-B+C=" +total);
 mul=A*B*C;
 System.out.println("A*B*C=" + mul);
 A2=A*A;
 System.out.println("A*A=" + A2);
 P3=(int) Math.pow(A,3);  //pow 次冪
 System.out.println("Math.pow=" + P3);
 sqa=(int) Math.sqrt(A);
 System.out.println("Math.sqrt(A)=" + sqa);
 AB=A/B;
 System.out.println("A/B=" + AB);
 ABC=(A*B)/C;
 System.out.println("(A*B)/C=" + ABC);
 ABC1=(A+B)/C;
 System.out.println("(A+B)/C=" + ABC1);
 ABC2=A+B/C;
 System.out.println("A+B/C=" + ABC2);
 }
}

 

 -----

 

 

package chap1;

import java.io.BufferedReader;
import java.io.InputStreamReader;
public class t102101 {
 public static void main(String args[]) throws Exception{
  BufferedReader br;
  br = new BufferedReader(new InputStreamReader(System.in));
  
  int A,B,C, sum,total,mul;
  double A2 ,P3,sqa,AB,ABC,ABC1,ABC2;
 System.out.println("請輸入第一個值");
 A = Integer.parseInt(br.readLine());//字串 
 System.out.println("請輸入第二個值");
 B = Integer.parseInt(br.readLine());
 System.out.println("請輸入第三個值");
 C = Integer.parseInt(br.readLine());
 System.out.println(A+"\t"+B+"\t"+C+"\n");
 
 sum = A+B+C;
 System.out.println("A+B+C=" +sum);
 total=A-B+C;
 System.out.println("A-B+C=" +total);
 mul=A*B*C;
 System.out.println("A*B*C=" + mul);
 A2=A*A;
 System.out.println("A*A=" + A2);
 P3=(int) Math.pow(A,3);  //pow 次冪
 System.out.println("Math.pow=" + P3);
 sqa=(int) Math.sqrt(A);
 System.out.println("Math.sqrt(A)=" + sqa);
 AB=A/B;
 System.out.println("A/B=" + AB);
 ABC=(A*B)/C;
 System.out.println("(A*B)/C=" + ABC);
 ABC1=(A+B)/C;
 System.out.println("(A+B)/C=" + ABC1);
 ABC2=A+B/C;
 System.out.println("A+B/C=" + ABC2);
 
 }
}

 

 

 

 

 

創作者介紹

寂 。

玥君 發表在 痞客邦 PIXNET 留言(0) 人氣()