QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#378117#7697. Impartial StringsmbenderCompile Error//C++14511b2024-04-06 04:39:482024-04-06 04:39:49

Judging History

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

  • [2024-04-06 04:39:49]
  • 评测
  • [2024-04-06 04:39:48]
  • 提交

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

answer.code:1:1: error: ‘import’ does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
answer.code:1:1: note: C++20 ‘import’ only available with ‘-fmodules-ts’
answer.code:3:1: error: expected unqualified-id before ‘public’
    3 | public class impartialstrings {
      | ^~~~~~