package bwk;
public class Hnil {
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "Hello World";
char[] c = str.toCharArray();
StringBuffer buffer = new StringBuffer();
for (int i = str.length() - 1; i >= 0; i--) {
if ((c[i] >= 'A') && (c[i] <= 'Z')) {
buffer.append(String.valueOf(c[i]).toLowerCase());
} else if ((c[i] >= 'a') && (c[i] <= 'z')) {
buffer.append(String.valueOf(c[i]).toUpperCase());
}
}
System.out.println(buffer.toString());
}
}
package bwk;
import java.util.Random;
public class Hnil {
public static void main(String[] args) {
// TODO Auto-generated method stub
Random rand = new Random();
int[] num = new int[5];
for (int i = 0; i < num.length; i++) {
num[i] = 20 + rand.nextInt(31);
System.out.println(num[i]);
}
}
}