Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

EJERCICIO 1

import java.util.*;

public class LAB1 {

public static void main(String[] args) {

int x,CD,D;

Scanner Leer=new Scanner(System.in);

System.out.print("Ingrese valor de x");

x=Leer.nextInt();

CD=0;

while(x>0){

D=x%10;

CD=CD+1;

x=x/10;

System.out.print(CD+ ",");

------------------------------ EJERCICIO 2-------------------------------

import java.util.*;

public class LAB2 {

public static void main(String[] args) {

int x,CP,CI,D;

Scanner Leer=new Scanner(System.in);

System.out.print("Ingrese valor de x ");

x=Leer.nextInt();

CP=0;CI=0;D=2;

while(x>0){

if (D%2==0){

CP=CP+1;

else {

CI=CI+1;

}
x=x/10;

System.out.print(CP + ",");

System.out.print(CI + ",");

--------------------------------EJERCICIO 3-------------------------------

import java.util.*;

public class LAB3 {

public static void main(String[] args) {

int x,CC,i,D,CDP;

Scanner Leer=new Scanner(System.in);

x=Leer.nextInt();

CDP=0;

while(x>0){

D=x%10;

CC=0;

for(i=1;1<=D;i++){

if (D%i==0){

CC=CC+1;

if (CC==2){

CDP=CDP+1;

x=x/10;

System.out.print(CDP + ",");

}
------------------------------EJERCICIO 4 -------------------------------

import java.util.*;

public class LAB4 {

public static void main(String[] args) {

int x,i,D,F;

Scanner Leer=new Scanner(System.in);

x=Leer.nextInt();

while(x>0){

D=x%10;

if (D%2==0){

F=1;

for(i=1;1<=D;i++){

F=F*i;

System.out.print(F + ",");

x=x/10;

------------------------------EJERCICIO 5 -------------------------------

import java.util.*;

public class LAB5 {

public static void main(String[] args) {

int x,D,INV;

Scanner Leer=new Scanner(System.in);

x=Leer.nextInt();

INV=0;

while(x>0){
D=x%10;

if (D%2==0){

INV=INV*10+D;

x=x/10;

System.out.print(INV + ",");

------------------------------EJERCICIO 6 -------------------------------

import java.util.*;

public class LAB6 {

public static void main(String[] args) {

int x,D,INV;

Scanner Leer=new Scanner(System.in);

x=Leer.nextInt();

INV=0;

D=x%10;

while(x>0){

INV=INV*10+D;

x=x/10;

System.out.print(INV + ",");

------------------------------EJERCICIO 7 -------------------------------

import java.util.*;

public class LAB7 {

public static void main(String[] args) {

int x,D,INV,A,Capicua,No Capicua;

Scanner Leer=new Scanner(System.in);

x=Leer.nextInt();

A=x;
INV=0;

while(x>0){

D=x%10;

INV=INV*10+D;

x=x/10;

if (INV==A){

System.out.print(Capicua+ ",");

else {

System.out.print(No Capicua + ",");

You might also like