1、/* To change this template, choose Tools | Templates* and open the template in the editor.*/package queue;import java.util.Scanner;/* author lntuxinke*/public class Queue int size=0,k=3,end=-1,start=0;double a=new doublek;public void in( )System.out .println(“请输入“);Scanner ss=new Scanner(System.in);
2、double f=ss.nextDouble();if(Isfull()=false)end+;aend=f;size+;oo();/end/System.out .println(“1 end=“+end+“ size=“+size +“ start=“+start);elseSystem.out .println(“满“);public void out()if(Isempty()=false)System.out .println(astart);size-;start+;ee();/start/System.out .println(“2 start=“+start+“ size=“+
3、size+“ end=“+end);elseSystem.out .println(“空“);public boolean Isempty()return (size=0);public boolean Isfull()return (size=k);public void oo()if(end=k)end=-1;public void ee()if(start=end+1start=0;if(start=k)start=0;public static void main(String args) Queue sc=new Queue();boolean l=true;while(l)System.out .println(“进按 1,出按 2,停按 3“);Scanner ss=new Scanner(System.in);int e=ss.nextInt();switch(e)case 1:sc.in();break;case 2:sc.out();break;case 3:l=false;break;