import java.util.Scanner;
/**
* 用户输入n1和n2:求不能同时被3和5整除的累加和
* @author 你好qiulinhe
*
*/
public class Ceshi {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("请依次输入1-10的数字");
for(int i=1;i<11;i++){
int ceshi = scanner.nextInt();
switch (ceshi) {
case 1:
System.out.println("1对应的字母是A");
break;
case 2:
System.out.println("2对应的字母是B");
break;
case 3:
System.out.println("3对应的字母是返则C");
break;
case 4:
System.out.println("4对应的字母是D");
break;
case 5:
System.out.println("5对应的字母是E");
break;
case 6:
System.out.println("6对应晌世亮宴宽的字母是F");
break;
case 7:
System.out.println("7对应的字母是G");
break;
case 8:
System.out.println("8对应的字母是H");
break;
case 9:
System.out.println("9对应的字母是I");
break;
case 10:
System.out.println("10对应的字母是J");
break;
default:
break;
}
}
}
}
结果为:
public String number2English(int 耐春i){
switch(i){
case 1: return "ONE";
case 氏亩饥2: return "TWO";
case 3: return "THREE";
case 4: return "FOUR";
case 5: return "FIVE";
case 6: return "SIX";
case 7: return "SEVEN";
case 8: return "EIGHT";
case 9: return "NINE";
case 10: return "TURN"歼返;
}
}