准备输入第三个数据的时候提示错误
import *;public class li1 {
/**
* @param args
*/
public static void main(String[] args) throws IOException{
char m;
float a,b;
float x=0;
String str;
BufferedReader buf;
buf=new BufferedReader(new InputStreamReader(System.in));
System.out.print("input:");
str=buf.readLine();
a=Float.parseFloat(str);
System.out.print("operator:");
m=(char)System.in.read();
System.out.print("input:");
str=buf.readLine();
b=Float.parseFloat(str);
switch(m)
{
case '+':x=a+b;break;
case '-':x=a-b;break;
case '*':x=a*b;break;
case '/':x=a/b;break;
}
System.out.println(x);
}
}