first commit

This commit is contained in:
Nyagami
2022-12-15 23:51:04 +07:00
commit 87d51fb251
292 changed files with 12623 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import java.util.Scanner;
public class Main {
static String check(String s){
for(int i=0;i<s.length();i++){
if("012".indexOf(s.charAt(i))==-1) return "NO";
}
return "YES";
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
for(int i=0;i<t;i++){
String s=sc.next();
System.out.println(check(s));
}
sc.close();
}
}