算法29
作者:互联网
1 import java.util.LinkedList; 2 import java.util.Scanner; 3 4 public class Test29 { 5 public static void main(String[] args) { 6 Scanner scan = new Scanner(System.in); 7 String str = scan.nextLine(); 8 LinkedList<String> op = new LinkedList<>(); 9 LinkedList<Integer> numList = new LinkedList<>(); 10 String temp = ""; 11 12 for (int i = 0; i < str.length(); i++) { 13 char ch= str.charAt(i); 14 if (ch==' '){ 15 continue; 16 } 17 if (ch=='('){ 18 op.addLast(str.substring(i+1,i+4)); 19 i=i+3; 20 }else if (str.charAt(i)==')'){ 21 22 }else if (ch == '-'||Character.isDigit(ch)){ 23 int j=i; 24 while (str.charAt(i)!=' '){ 25 j++; 26 } 27 int num0 = Integer.parseInt(str.substring(i, j + 1)); 28 29 } 30 } 31 } 32 }View Code
标签:ch,LinkedList,int,29,算法,str,new,String 来源: https://www.cnblogs.com/doremi429/p/16386166.html