Index of outlier

Index of outlier. Given three integers: two are equal to each other and the third one is different. Print the index number of this different one – 1, 2 or 3. Input Correct answer 10 5 10 2 10 10 5 3 4 -82 -82 1 5 2 5 2 100 100 300 3

Queen move

Queen move. Chess queen moves horizontally, vertically or diagonally to any number of cells. Given two different cells of the chessboard, determine whether a queen can go from the first cell to the second in one move. The program receives the input of four numbers from 1 to 8, each specifying the column and row …

Bishop moves

Bishop moves. In chess, the bishop moves diagonally, any number of squares. Given two different squares of the chessboard, determine whether a bishop can go from the first to the second in one move. The program receives as input four numbers from 1 to 8, specifying the column and row numbers of the starting square …

King move

King move. Chess king moves horizontally, vertically or diagonally to any adjacent cell. Given two different cells of the chessboard, determine whether a king can go from the first cell to the second in one move. The program receives the input of four numbers from 1 to 8, each specifying the column and row number, …

Four-digit palindrome

Four-digit palindrome. A palindrome is a number which reads the same when read forward as it it does when read backward. Given a four-digit integer, print “YES” if it’s a palindrome and print “NO” otherwise. Input Output 1221 YES 1231 NO 5775 YES 5777 NO 5776 NO  

Chess board – same color

Chess board – same color. Given two cells of a chessboard. If they are painted in one color, print the word YES, and if in a different color – NO. The program receives the input of four numbers from 1 to 8, each specifying the column and row number, first two – for the first cell, and …

Rook move

Rook move. Chess rook moves horizontally or vertically. Given two different cells of the chessboard, determine whether a rook can go from the first cell to the second in one move. The program receives the input of four numbers from 1 to 8, each specifying the column and row number, first two – for the …