当前位置:网站首页>The circular queue is implemented in super detail. I understand it in a few seconds

The circular queue is implemented in super detail. I understand it in a few seconds

2022-06-22 09:14:00 C_ x_ three hundred and thirty

package com.Cx_330.run;

import org.junit.Test;

import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*;


public class CCC {
    public static void main(String[] args) {
        Queue queue = new Queue(5);
        boolean leap=true;
        Scanner scanner = new Scanner(System.in);
        String choice;
        while (leap)
        {
            System.out.println(" Please enter the selection " +
                    "1. Add elements " +
                    "2. Get team leader elements " +
                    "3. Traverse the queue " +
                    "4. sign out ");

            choice=scanner.next();
            switch (choice){
                case "1":
                    try {
                        System.out.println(" Please enter add element ");
                        int key=scanner.nextInt();
                        queue.add(key);
                    } catch (Exception e) {
            
原网站

版权声明
本文为[C_ x_ three hundred and thirty]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206220910014541.html