package com.chapter.BJ.UpperLower;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) >= 65 && str.charAt(i) <= 90) {
str.charAt(i) += 32;
} else if (str.charAt(i) <= 122 && str.charAt(i) >= 97) {
str.charAt(i) -= 32;
}
System.out.print(str.charAt(i));
}
}
}
Hello everyone, I don't understand why I get an error on str.charAt(i) += 32;
and str.charAt(i) -= 32;
. Thank you for your help.