import java.util.Scanner;
class Ideone {
public static void main
(String[] args
) { Scanner on
= new Scanner
(System.
in); System.
out.
println("Digite a palavra: "); int soma = 0;
for (char caractere : texto.toCharArray()) {
//"A" vale 97, então tira 96 e assim por diante
soma += caractere > 96 && caractere < 123 ? caractere - 96 : 0;
}
}
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKY2xhc3MgSWRlb25lIHsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKCQlTY2FubmVyIG9uID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsgCgkJU3lzdGVtLm91dC5wcmludGxuKCJEaWdpdGUgYSBwYWxhdnJhOiAiKTsKCQlTdHJpbmcgdGV4dG8gPSBvbi5uZXh0TGluZSgpOwoJCWludCBzb21hID0gMDsKCQlmb3IgKGNoYXIgY2FyYWN0ZXJlIDogdGV4dG8udG9DaGFyQXJyYXkoKSkgewogICAgICAgICAgICAvLyJBIiB2YWxlIDk3LCBlbnTDo28gdGlyYSA5NiBlIGFzc2ltIHBvciBkaWFudGUKICAJCQlzb21hICs9IGNhcmFjdGVyZSA+IDk2ICYmIGNhcmFjdGVyZSA8IDEyMyA/IGNhcmFjdGVyZSAtIDk2IDogMDsKCQl9CgkJU3lzdGVtLm91dC5wcmludGxuKHNvbWEpOyAgICAKICAgIH0gIAp9