while(s.equals("+") || s.equals("-") || s.equals("*") || s.equals("/")){ str = s; }改成:if(s.equals("+") || s.equals("-") || s.equals("*") || s.equals("/")){str = s;}