Competitive Programming Solutions

GitHub
back to dashboard

M. Capital or Small or Digit

Codeforces - Sheet #1 (Data type - Conditions) · limit: 1s · memory: 256MB · view on codeforces

input

A

output

ALPHA
IS CAPITAL
Main.java
static void solve() {

        // Write your solution here
        char c = in.next().charAt(0);
        if (c >= '0' && c <= '9') {
            out.print("IS DIGIT");
        } else if (c >= 'A' && c <= 'Z') {
            out.print("ALPHA\nIS CAPITAL");
        } else if (c >= 'a' && c <= 'z') {
            out.print("ALPHA\nIS SMALL");
        }
    }