public class CTest {
public static void main(String[] args) {
/**
* 随机输出一个字母,将小写字母转化为大写字母
*/
int random=(int) Math.round(Math.random()*26+97);
char temp= (char) random;
System.out.println(temp);
if((int) temp>97&(temp<114))
temp = (char)((int)temp - 32);
System.out.println("大写字母:" + (char)temp);
}
}
public static void main(String[] args) {
/**
* 随机输出一个字母,将小写字母转化为大写字母
*/
int random=(int) Math.round(Math.random()*26+97);
char temp= (char) random;
System.out.println(temp);
if((int) temp>97&(temp<114))
temp = (char)((int)temp - 32);
System.out.println("大写字母:" + (char)temp);
}
}