Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String word = scanner.nextLine();
- if (word == word.toLowerCase()) {
- System.out.println("field");
- } else if (word == word.toUpperCase()) {
- System.out.println("constant");
- }else if(word.matches("[A-Z][a-z]+") ){
- System.out.println("pascal");
- }else if(word.matches(("[a-z]+[A-Z]+"))){
- System.out.println("elephant");
- }else{
- System.out.println("mismatch");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment