Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class asfg {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int numberOfInputs = Integer.parseInt(input.nextLine());
- boolean isSymmetrical = false;
- int holdingInt = 0;
- for (int i = 0; i < input.nextInt(); i++) {
- String[] inputString = input.nextLine().split(" ");
- holdingInt = inputString.length - 1;
- for (int j = 0; j < inputString.length / 2; j++){
- if (inputString[j].equals(inputString[holdingInt])){
- isSymmetrical = true;
- }else {
- isSymmetrical = false;
- break;
- }
- holdingInt--;
- }
- if (isSymmetrical){
- System.out.println("Yes");
- }else {
- System.out.println("No");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement