Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class comp9 {
- public static void main(String[] args) {
- int num, cont, aux;
- Scanner sc = new Scanner(System.in);
- System.out.println("Introduce el número");
- cont = 0;
- num = sc.nextInt();
- aux = num;
- while (num >0) {
- num = num/10;
- cont++;
- }
- System.out.println(aux+" tiene "+cont+" cifras");
- System.out.println("Introduce un número");
- num = sc.nextInt();
- sc.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement