当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·求一條sql 語句    »显示摘要«
    摘要: 數據庫是: ms sql severl 有一這樣的表 a 表a 的 field 和 values 如下: 時間,地點,發生的事件 為關鍵字 時間 地點 發生的事件 2003-09-01 aa 1 2003-09-01 bb 2 2003-09-02 aa 3 2003-09-03 cc 1 2003-09-03 cc 2 2003-09-03 cc 3 我想要的結果是這樣的......
 ·简单问题,送分了,赫赫    »显示摘要«
    摘要: 小弟初学directdraw,请各位老大赐教: q:那里得到directdraw7的例子? q:如何在directx8.1或者directx9里面使用directdraw7,只能直接使用?还是有什么新的接口? 关键是例子程序,有什么好的可以看例子的地方也行 ......


java编程,读如数据编写格式怎么写(超级新手问题)

想从键盘读如一个数据,再进行计算怎么写?  
  //:   Jexample2.java  
  import   java.io.*;  
  public   class   Jexample2{  
  public   static   void   main(String[]   args){  
  System.out.println("Enter   a   letter:");  
  int   n=4;  
  /* try{  
  n=(int)System.in.read();  
  }catch(IOException   e){};   */  
  System.out.println("The   number   is:"+step(n));  
  }  
  static   long   step(int   n){  
  int   a=n;  
  if(a==1)  
  return   a;  
  else   {  
  long   sum=11;  
  sum=a*step(a-1);  
  return   sum;}  
  }  
  }  
  如程序所示,n改成由键盘输入.  
  请大家指点...

NO.1   作者: yangFrame

//:   Jexample2.java  
  import   java.io.*;  
  import   javax.swing.*;  
   
  public   class   Jexample2{  
  public   static   void   main(String[]   args){  
  System.out.println("Enter   a   letter:");  
  int   n;  
                  String   input=JOptionPane.showInputDialog("请输入n的值");  
                                  n=Integer.parseInt(input);  
  System.out.println("The   number   is:"+step(n));  
  }  
  static   long   step(int   n){  
  int   a=n;  
  if(a==1)  
  return   a;  
  else   {  
  long   sum=11;  
  sum=a*step(a-1);  
  return   sum;}  
  }  
  }  
 

NO.2   作者: powerpanda

public   static   void   main(String[]   args)  
  {    
    System.out.println("Enter   a   letter:");  
    String   s   ="   ";  
    int   n;  
    try  
    {  
      BufferedReader   in   =   new   BufferedReader(   new   InputStreamReader(   System.in)   );  
      s   =   in.readLine();  
      }catch(IOException   e)   {}  
      n   =   Integer.parseInt(s.substring(0,b));//b为你要读入的数据的长度  
   
   
  }  
 

NO.3   作者: chinadfw

你现在的问题是输入的数字变成了asc   码对应的值.  
  你可以用下面的方法将它转化成输入的10进制.  
   
  //:   Jexample2.java  
  import   java.io.*;  
  public   class   Jexample2{  
  public   static   void   main(String[]   args){  
  System.out.println("Enter   a   letter:");  
  int   n=4;  
   
                  String   str;  
                  BufferedReader   buf;  
                   
                   
  try{  
  //n=(int)System.in.read();  
  buf=new   BufferedReader(new   InputStreamReader(System.in));  
   
  str   =   buf.readLine();  
   
  n   =   Integer.parseInt(str);  
  }catch(IOException   e){};    
  System.out.println("The   number   is:"+step(n));  
  }  
  static   long   step(int   n){  
  int   a=n;  
  if(a==1)  
  return   a;  
  else   {  
  long   sum=11;  
  sum=a*step(a-1);  
  return   sum;}  
  }  
  }  
   
   
  运行后输出结果如下  
   
  Enter   a   letter:  
  3  
  The   number   is:6


 ·怎样使dialog能够自由缩放。    »显示摘要«
    摘要: 怎样使dialog能够自由缩放,我这样做好像无效 precreatewindow(createstruct& cs) { cs.style|=ws_thickframe; return cdialog::precreatewindow(cs); } 感觉就是dialog创建时根本就不执行precreatewindow一样,我修改为 precreatewindow(creates......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE