public class day013_2 {
public static void main(String[] args) {
String str = getData();
char[] ch = str.toCharArray();
methd(ch);
}
private static void methd(char[] ch) {
for (int i = 0; i < ch.length; i++) {
if (ch[i]<=90&&ch[i]>=65) {
ch[i]=(char)(ch[i]+32);
}else if (ch[i]>=97&&ch[i]<=122) {
ch[i]=(char)(ch[i]-32);
}
}
System.out.println(String.valueOf(ch));
}
public static String getData(){
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
return str;
}
} |
|