日期:2014-05-20  浏览次数:20609 次

急,java 键盘输入变量问题
class   Tgyl   {                          
private       int   max=200;        
                          int   h=5;                
public   int   gh(int   x)  
{if   (x> =5*max)   x=x-15;   //供货商暂停采购            
else                                     //供货商请求采购
{if(x <20)     x=x+20;    
              else           x=x+20-15;
}return   x;}
  public   int   zz(int   y)  
{if   (y> =max)   y=y-2;     //制造商暂停采购
              else                                 //制造商请求采购
{if(y <3)   y=y+3;
                    else         y=y+3-2;
                    }return   y;}    
}
class   gyl{
  public   static   void   main(String[]   args)
            {int   t1=210;   //输入不同的t1值,则改变各个节点库存
              int   D=30;     //输入不同的D值,产生不同的订单数量  
              System.out.println( "on   the   "+t1+ "th   day,the   order   arrive   and   the   volume   is   "+D);      
              int   t2=1;     //完成差异件需求所需要的时间
              int   t3;
              int   t4=0;
              int   p1=0;     //供货商零部件库存
              int   p3=0;     //制造商通用件库存
              int   p4=0;     //分销商通用件库存
              int   p5=0;     //订单成品完成量
              int   pp=0;
              int   p14=0;     //   分销商差异件库存
              int   p=6;       //   一件成品中包括6件通用件
              int   q=3;       //   一件成品中包括3件差异件
              Tgyl   m   =   new   Tgyl();
              int   t;
              int   T;     //完成定单的全部响应时间
              for   (t=1;t <t1;t++){
  if(t> =4){if   (p4> =200)
                            break;       //分销商暂停采购
                                                  else