こんにちはiamは以下の問題でランタイムエラーを把握できません。誰でも解決できますか
import java.util.Scanner;
class Solution6 {
public static void main(String[] args)
{
boolean condition = false;
do
{
Scanner scanner = new Scanner(System.in);
String value = scanner.nextLine();
condition = value.equalsIgnoreCase("exit");
if(!condition && value.contains(","))
{
calculate(value);
}
} while (!condition);
}
private static void calculate(String value)
{
final String[] event1 = value.split(",");
int ss = 0;
for ( int i = 0; i < event1[0].length(); ++i )
{
char c = event1[0].charAt( i );
ss += (int) c;
}
int sd = 0;
for ( int i = 0; i < event1[1].length(); ++i )
{
char c = event1[1].charAt( i );
sd += (int) c;
}
System.out.println(ss-sd);
}
}