Advertisement
KahnClifford

Untitled

Dec 7th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class A {
  4. public static void main(String[] args) {
  5. int thenumbers;
  6. String theletters;
  7. Scanner input = new Scanner(System.in);
  8. String temp = input.next();
  9. theletters = temp.replaceAll("\\d","");
  10. thenumbers = temp.length() - theletters.length();
  11. System.out.println("Letters: "+theletters.length()+"\nNumbers: "+thenumbers);
  12. }
  13.  
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement