📅  最后修改于: 2022-03-11 14:48:35.245000             🧑  作者: Mango
public class digits
{
public static void main (String letter)
{
if (letter=="A" || letter=="B" || letter== "C")
{
System.out.println("1");
}
else if(letter=="D" || letter=="E" || letter== "F")
{
System.out.println("2");
}
else if (letter=="G" || letter=="H" || letter== "I")
{
System.out.println("3");
}
else if (letter=="J" || letter=="K" || letter== "L")
{
System.out.println("4");
}
else if (letter=="M" || letter=="N" || letter== "O")
{
System.out.println("5");
}
else if (letter=="P" || letter=="Q" || letter== "R" || letter== "S")
{
System.out.println("6");
}
else if (letter=="T" || letter=="U" || letter== "V")
{
System.out.println("7");
}
else if (letter=="W" || letter=="X" || letter== "Y" || letter== "Z")
{
System.out.println("9");
}
}
}