摘要: 例3-4import java.util.*;public class Example3_4{public static void main(String args[]){Scanner reader=new Scanner(System.in);System.out.println("输入一个月份:");int n=reader.nextInt();switch(n){case 1:case 2:case 3:System.out.printf("%d月是属于第一季度",n);break;case 4:case 5:case 6:System.out. 阅读全文
posted @ 2013-03-15 18:40 徐慧同学 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 例3-2public class Test3_2{public static void main(String args[]){char a[]={'金','木','水','火','土'};char secret='z';for(int i=0;i<a.length;i++){a[i]=(char)(a[i]^secret);}System.out.printf("密文:\n");for(int i=0;i<a.length;i++){System.out.print 阅读全文
posted @ 2013-03-15 18:39 徐慧同学 阅读(182) 评论(0) 推荐(0) 编辑