Administrator.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Administrator
*/
public class Administrator {
public void giveMess(int number){
if(number/10000<=0 ||number/10000>=10){
System.out.println("please input fifth numbers");
}
else{
int num1=number%10;
int num2=number%100;
int num3=number%1000;
switch(num1){
case 1:
case 3:
case 9:System.out.println("three!!!!");
break;
default:System.out.println("no have three!!!!");
}
switch(num2){
case 29:
case 46:
case 21:System.out.println("two!!!!");
break;
default:System.out.println("no have two!!!!");
}
switch(num3){
case 875:
case 326:
case 596:System.out.println("one!!!!");
break;
default:System.out.println("no have one!!!!");
}
}
}
}
Test.java
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Administrator
*/
public class Test {
public static void main(String[] args){
Scanner reader=new Scanner(System.in);
System.out.println("please input the number:");
int number = reader.nextInt();
Administrator person=new Administrator();
person.giveMess(number);
}
}