标签:
package com.homework.zw; //类Print部分 public class Print1 { int x; void output() { if(x==1) { for(int i =65;i<=90;i++) { char a =(char) i; System.out.print(a); } } else if(x==2) { for(int i =97;i<=122;i++) { char a =(char) i; System.out.print(a); } } } }
package com.homework.zw; //主类textclass部分 import java.util.Scanner; public class Textclass { public static void main(String[] args) { Print1 pr = new Print1(); Scanner sc = new Scanner(System.in); System.out.println("请输入x的值"); pr.x=sc.nextInt(); pr.output(); } }
标签:
原文地址:http://www.cnblogs.com/HRZJ/p/5878018.html