算法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

 

posted @ 2022-06-17 16:21  doremi429  阅读(2)  评论(0编辑  收藏  举报