2013年3月17日

摘要: import java.util.Scanner;public class Example3_1 { /** * @param args */ public static void main(String[] args) { Scanner reader =new Scanner(System.in); System.out.println("输入待移位的int型整数: "); int x =reader.nextInt(); System.out.println("输入位移量: "); int n =reader.nextInt(); System.o 阅读全文
posted @ 2013-03-17 22:04 杜佳润 阅读(118) 评论(0) 推荐(0)
摘要: import java.util.*;import javax.print.DocFlavor.READER;public class Example2_4 { /** * @param args */ public static void main(String[] args) { Scanner reader = new Scanner(System.in); double sum =0; int m =0; while(reader.hasNextDouble()){ double x=reader.nextDouble(); m=m+1; sum=sum+x; ... 阅读全文
posted @ 2013-03-17 22:03 杜佳润 阅读(140) 评论(0) 推荐(0)
摘要: public class Example2_2 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stu byte a =120; short b=130; int c=2200; long d=80000; float f; double g=0.12345676812345678; a=(byte)b; c=(int)d; f=(float)g; System.out.println("a="+a); System.out.p... 阅读全文
posted @ 2013-03-17 22:02 杜佳润 阅读(111) 评论(0) 推荐(0)
摘要: public class Example2_1 { /** * @param args */ public static void main(String[] args) { char c='a'; System.out.println("zimu" + c +"zaibiaozhongdeweizhi "+(int)c); System.out.println("zimubiao"); for(int i =(int)c;i<c+25;i++){ System.out.print(""+(c 阅读全文
posted @ 2013-03-17 22:01 杜佳润 阅读(143) 评论(0) 推荐(0)
摘要: import java.util.*;class B{ public static void main (String args []){ Scanner reader=new Scanner(System.in); double i = 1; while(reader.hasNextDouble()){ i*=reader.nextDouble(); } System.out.println(i); }} 阅读全文
posted @ 2013-03-17 22:00 杜佳润 阅读(116) 评论(0) 推荐(0)

2013年3月7日

摘要: import java.util.*;class dujiarun { public static void main(String []args){ Scanner reader = new Scanner(System.in); int s=1; while(reader.hasNextInt()){ int x=reader.nextInt(); s=s*x; System.out.println(s); } } } 阅读全文
posted @ 2013-03-07 23:22 杜佳润 阅读(82) 评论(0) 推荐(0)

2013年3月4日

摘要: Java程序中的每个变量要么是基本数据类型(boolean, char, byte, short, int, long, float, double),要么是对对象的引用C++有许多种基本类型,额外还有struct, union, enum, 数组和指针,C++指针可以指向对象,也可以不指向对象Java没有枚举、联合类型,因为Java认为没有必要。将可有可无的语言元素去掉是Java对C/C++做出的一大改变,因此,普遍认为Java较C++更轻便,更精简Java采用Unicode字符集,C++通常用ASCII字符集。但ASCII是Unicode的子集,对于习惯于ASCII的程序员感觉不到区别Ja 阅读全文
posted @ 2013-03-04 13:02 杜佳润 阅读(119) 评论(0) 推荐(0)

导航