Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class palabras {
  4. public static void main(String args[]) {
  5. Scanner teclado = new Scanner(System.in);
  6.  
  7. System.out.println("Escriba una cadena.");
  8. String x = teclado.nextLine();
  9. int s = x.length();
  10. int f = 0;
  11. char t;
  12. for (int i = 1; i < s; i++) {
  13. t = x.charAt(i);
  14. for (char a = 'a'; a <= t; a++) {
  15.  
  16. }
  17. f = f+i;
  18.  
  19. }
  20. System.out.println(f);
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement