满意答案
抛砖引玉:没有校验:只实现a+13=n
中间的方法也许有用:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class test
{
public static void main(String args[]) throws IOException
{
InputStreamReader isr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(isr);
String line;
String[] spl = null;
while(true)
{
System.out .print(">>");
line=br.readLine();
//if(((line=br.readLine())!=null) && line.equals("quit"))
if(line!=null && line.equals("quit"))
{
break;
}
else
{
try{
spl = line.split("[+]");
}
catch(Exception e)
{
e.printStackTrace();
}
int var = (int)(spl[0].trim().charAt(0)) + Integer.parseInt(spl[1]);
System.out.println((char)var);
}
}
}
}
00分享举报