Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class PostfixCalculator {
  4.  
  5. public static void calculator(String [] posfix){
  6. String current = "";
  7. char c;
  8.  
  9. for (int i = 0; i < posfix.length; i++){
  10. current = posfix[i];
  11. c = current.charAt(0);
  12.  
  13. if (c >= '0' && c <= '9'){
  14.  
  15. }
  16. }
  17. }
  18.  
  19. public static void main (String [] args) {
  20. infix_to_postfix infix = new infix_to_postfix();
  21. String string = "";
  22. Scanner scanner = new Scanner(System.in);
  23.  
  24. while (true) {
  25. string = scanner.nextLine();
  26.  
  27. String[] infixS = string.split(" ");
  28.  
  29. calculator(infix.infix_to_postfix(infixS).split(" "));
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement