Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class palabras {
- public static void main(String args[]) {
- Scanner teclado = new Scanner(System.in);
- System.out.println("Escriba una cadena.");
- String x = teclado.nextLine();
- int s = x.length();
- int f = 0;
- char t;
- for (int i = 1; i < s; i++) {
- t = x.charAt(i);
- for (char a = 'a'; a <= t; a++) {
- }
- f = f+i;
- }
- System.out.println(f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement