零度
天行健,君子以自强不息;地势坤,君子以厚德载物。

郑重声明,尽管这样子不文明,但还是先对这破电脑发泄发泄吧,不对人发泄就没有伤害!

妈蛋,这年头使用电脑太多,离开的电脑就是这么的个东西都写不出来了,真是丢人丢大了!

今天去面试,从市政府做的是8路公交,应聘的是517号金色堤岸写字楼11层,可谓“一生一世要发了”啊!但估计挂了!不是老天不长眼,而是才知道自己有多菜,做项目再多有什么用?????????????????????????????????????????????回来自己在电脑上一试,妈蛋,好简单,手写就是写不出来!讨厌死了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

懒得想那么多了:

简单的的实现验证输入的8个数字是不是皇后棋盘规则!

 

 

package graphTraversal;

 

import java.util.Scanner;

 

/**
 * 判断输入的8个数字不是符合8X8皇后棋盘
 *
 * @author Administrator
 *
 */
public class QueenBoard {

 

 // 判断函数
 private void evaluation(int a, int b, int c, int d, int e, int f, int g,
   int h) {
  System.out.println("您输入的数字是:");
  System.out.println(""+a+b+c+d+e+f+g+h);
  if (((1 == a & 9 != b & 10 != b)
    || (2 == a & 9 != b & 10 != b & 11 != b)
    || (3 == a & 10 != b & 11 != b & 12 != b)
    || (4 == a & 11 != b & 12 != b & 13 != b)
    || (5 == a & 12 != b & 13 != b & 14 != b)
    || (6 == a & 13 != b & 14 != b & 15 != b)
    || (7 == a & 14 != b & 15 != b & 16 != b)
    || (8 == a & 15 != b & 16 != b))
    
    & ((9 == b & 17 != c & 18 != c)
      || (10 == b & 17 != c & 18 != c & 19 != c)
      || (11 == b & 18 != c & 19 != c & 20 != c)
      || (12 == b & 19 != c & 20 != c & 21 != c)
      || (13 == b & 20 != c & 21 != c & 22 != c)
      || (14 == b & 21 != c & 22 != c & 23 != c)
      || (15 == b & 22 != c & 23 != c & 24 != c)
      || (16 == b & 23 != c & 24 != c))
      
    & ((17 == c & 25 != d & 26 != d)
      || (18 == c & 25 != d & 26 != d & 27 != d)
      || (19 == c & 26 != d & 27 != d & 28 != d)
      || (20 == c & 27 != d & 28 != d & 29 != d)
      || (21 == c & 28 != d & 29 != d & 30 != d)
      || (22 == c & 29 != d & 30 != d & 31 != d)
      || (23 == c & 30 != d & 31 != d & 33 != d)
      || (24 == c & 31 != d & 33 != d))
      
    & ((25 == d & 33 != e & 34 != e)
      || (26 == d & 33 != e & 34 != e & 35 != e)
      || (27 == d & 34 != e & 35 != e & 36 != e)
      || (28 == d & 35 != e & 36 != e & 37 != e)
      || (29 == d & 36 != e & 37 != e & 38 != e)
      || (30 == d & 37 != e & 38 != e & 39 != e)
      || (31 == d & 38 != e & 39 != e & 40 != e)
      || (32 == d & 39 != e & 40 != e))
      
    & ((33 == e & 41 != f & 42 != f)
      || (34 == e & 41 != f & 42 != f & 43 != f)
      || (35 == e & 42 != f & 43 != f & 44 != f)
      || (36 == e & 43 != f & 44 != f & 45 != f)
      || (37 == e & 44 != f & 45 != f & 46 != f)
      || (38 == e & 45 != f & 46 != f & 47 != f)
      || (39 == e & 46 != f & 47 != f & 48 != f)
      || (40 == e & 47 != f & 48 != f))
      
    & ((41 == f & 49 != g & 50 != g)
      || (42 == f & 49 != g & 50 != g & 51 != g)
      || (43 == f & 50 != g & 51 != g & 52 != g)
      || (44 == f & 51 != g & 52 != g & 53 != g)
      || (45 == f & 52 != g & 53 != g & 54 != g)
      || (46 == f & 53 != g & 54 != g & 55 != g)
      || (47 == f & 54 != g & 55 != g & 56 != g)
      || (48 == f & 55 != g & 56 != g))
      
    & ((49 == g & 57 != h & 58 != h)
      || (50 == g & 57 != h & 58 != h & 59 != h)
      || (51 == g & 58 != h & 59 != h & 60 != h)
      || (52 == g & 59 != h & 60 != h & 61 != h)
      || (53 == g & 60 != h & 61 != h & 62 != h)
      || (54 == g & 61 != h & 62 != h & 63 != h)
      || (55 == g & 62 != h & 63 != h & 64 != h)
      || (56 == g & 63 != h & 64 != h))){
   System.out.println("正确!");
  } else {
   System.out.println("您输入的数字不符合拜访皇后棋盘!");
  }
 }
 public static void main(String[] args) {
  QueenBoard queenBoard = new QueenBoard();
  Scanner scanner = new Scanner(System.in);
  int a,b,c,d,e,f,g,h;
  System.out.println("请输入1——8的数字:");
  a = scanner.nextInt();
  System.out.println("请输入9——16的数字:");
  b = scanner.nextInt();
  System.out.println("请输入17——24的数字:");
  c = scanner.nextInt();
  System.out.println("请输入25——32的数字:");
  d = scanner.nextInt();
  System.out.println("请输入33——40的数字:");
  e = scanner.nextInt();
  System.out.println("请输入41——48的数字:");
  f = scanner.nextInt();
  System.out.println("请输入49——56的数字:");
  g = scanner.nextInt();
  System.out.println("请输入57——64的数字:");
  h = scanner.nextInt();
  
  queenBoard.evaluation(a,b,c,d,e,f,g,h);
 }
}

 

posted on 2014-11-25 19:06  青青之兰  阅读(214)  评论(0编辑  收藏  举报