算法29

2022/6/18 1:21:23

本文主要是介绍算法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

 



这篇关于算法29的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程