Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Einzelzeichen {
- public static void main(String[] args) {
- String readLine;
- char eingabe;
- int ascii;
- Scanner scan = new Scanner(System.in);
- readLine = scan.nextLine();
- eingabe = readLine.charAt(0);
- ascii = eingabe;
- if(ascii >= '0' && ascii <= 'f'){
- if(ascii >= '0' && ascii <= '9'){
- System.out.println("Hexadezimale Ziffer");
- if(ascii == '0' || ascii == '1'){
- System.out.println("binäre Ziffer");
- }
- if(ascii != '8'){
- System.out.println("oktale Ziffer");
- }
- }
- if(ascii >= 'A' && ascii <= 'Z'){
- System.out.println("Großbuchstabe");
- }
- if(ascii >= 'A' && ascii <= 'F' || ascii >= 'a' && ascii <= 'f'){
- System.out.println("Hexadezimale Ziffer");
- }
- }
- else{
- System.out.println("Unbekannt");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement