Java - 輸入八個整數做右列 其結果為何 ?

輸入八個整數做右列 其結果為何 ?
 a*b%c|d*e^f*g-h>>>1
 a=5 b=8 c=6 d=9 e=7 f=3 g=5 h=2



  1. import java.util.*;
  2.  
  3. public class Java_Input_8_number
  4. {
  5.  
  6. public static void main(String[] args)
  7. {
  8. // TODO 自動產生的方法 Stub
  9. Scanner scan = new Scanner(System.in);
  10. System.out.print("請輸入 a b c d e f g h (以空白分隔:)");
  11. int a, b, c, d, e, f, g, h;
  12. a = scan.nextInt();
  13. b = scan.nextInt();
  14. c = scan.nextInt();
  15. d = scan.nextInt();
  16. e = scan.nextInt();
  17. f = scan.nextInt();
  18. g = scan.nextInt();
  19. h = scan.nextInt();
  20. int num = a * b % c | d * e ^ f * g - h >>> 1;
  21. System.out.println(num);
  22. }
  23.  
  24. }
  25.  

留言

這個網誌中的熱門文章

C# 井字遊戲