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)

导航