QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#378118#7697. Impartial StringsmbenderCompile Error//Java8511b2024-04-06 04:40:092024-04-06 04:40:10

Judging History

你现在查看的是最新测评结果

  • [2024-04-06 04:40:10]
  • 评测
  • [2024-04-06 04:40:09]
  • 提交

answer

import java.util.Scanner;

public class impartialstrings {
	public static void main(String[] args){
		Scanner scanner = new Scanner();
		
		String line = scanner.getLine();
		int K = Integer.parseInt(k);
		while(K-- > 0){
			line = scanner.getLine();
			String[] arr = line.split(" "); 
			
			String A = arr[0];
			String S = arr[1];
			String T = arr[2];
			
			System.out.println((S.equals(T)) || (A.length() <= 2 && S.charAt(0)!=S.charAt(1) && T.charAt(0)!= T.charAt(1))) ? 1:0);
		}
	}
}

Details

impartialstrings.java:18: error: not a statement
			System.out.println((S.equals(T)) || (A.length() <= 2 && S.charAt(0)!=S.charAt(1) && T.charAt(0)!= T.charAt(1))) ? 1:0);
			                                                                                                                ^
impartialstrings.java:18: error: ';' expected
			System.out.println((S.equals(T)) || (A.length() <= 2 && S.charAt(0)!=S.charAt(1) && T.charAt(0)!= T.charAt(1))) ? 1:0);
			                                                                                                                     ^
2 errors