import java.io.*;
public class Problem4
{
public static void main(String[] args) {
try {
InputStreamReader sr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(sr);
String str = br.readLine();
String data[] = str.split(",");
int sum[] = new int[data.length];
for (int i = 0; i < data.length; i++)
{
for (int j = 0; j < data[i].length(); j++)
{
sum[i] = sum[i] + (int) data[i].charAt(j);
}
}
int dif = sum[0];
for (int i = 1; i < sum.length; i++)
{
dif = dif - sum[i];
}
System.out.println("Diff :" + dif);
} catch (Exception ex)
{
System.out.println(ex);
}
}
}
public class Problem4
{
public static void main(String[] args) {
try {
InputStreamReader sr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(sr);
String str = br.readLine();
String data[] = str.split(",");
int sum[] = new int[data.length];
for (int i = 0; i < data.length; i++)
{
for (int j = 0; j < data[i].length(); j++)
{
sum[i] = sum[i] + (int) data[i].charAt(j);
}
}
int dif = sum[0];
for (int i = 1; i < sum.length; i++)
{
dif = dif - sum[i];
}
System.out.println("Diff :" + dif);
} catch (Exception ex)
{
System.out.println(ex);
}
}
}
|
No comments:
Post a Comment