miércoles, 10 de junio de 2015

PROBLEMA 45



/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package problema45dadounnumerodeterminarcuantosdigitostiene;
import java.util.Scanner;
/**
 *

 */
public class Problema45dadounnumerodeterminarcuantosdigitostiene {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       int n,c=0;
       Scanner teclado=new Scanner(System.in);
       System.out.println("Número: " );
       n=teclado.nextInt();
       
       while (n>0)
       {
       n=n/10;
       c+=1;
       }
       System.out.println(" " );
       System.out.println("Cantidad de Dígitos: "+c);

    }
}

PROBLEMA 44



/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package problema44cantidaddeprimerosnnumerosmultiplosde5;
import java.util.Scanner;
/**
 *

 */
public class Problema44cantidaddeprimerosnnumerosmultiplosde5 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
     int i, n,c=0;
       Scanner teclado=new Scanner(System.in);
       System.out.println("Número: " );
       n=teclado.nextInt();
       i=1;
       while (i<=n)
       {
       if  (i%5==0)
       {    
       c+=1;
       }
       i++;
       
       }       
       System.out.println(" " );
       System.out.println("Cantidad: "+c);

    }
}

PROBLEMA 43



/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package problema43dadounrangodenumerosenterosobtenerlacantidaddenumerospares;
import java.util.Scanner;
/**
 *

 */
public class PROBLEMA43DADOUNRANGODENUMEROSENTEROSOBTENERLACANTIDADDENUMEROSPARES {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       
     int i, ni,nf,cp=0;
       Scanner teclado=new Scanner(System.in);
       System.out.println("Número Inicial: " );
       ni=teclado.nextInt();
       System.out.println("Número Final: " );
       nf=teclado.nextInt();
       i=ni+1;
       while (i<nf)
       {
       if  (i%2==0)
       {    
       cp+=1;
       }
       i++;
       
       }       
       System.out.println(" " );
       System.out.println("Cantidad Pares: "+cp);

    }
}

PROBLEMA 42



/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package problema42dadounrangodenumerosenterosobtenerlacantidaddenumerosenterosquecontiene;
import java.util.Scanner;
/**
 *

 */
public class PROBLEMA42DADOUNRANGODENUMEROSENTEROSOBTENERLACANTIDADDENUMEROSENTEROSQUECONTIENE {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
     int i, ni,nf,c=0;
       Scanner teclado=new Scanner(System.in);
       System.out.println("Número Inicial: " );
       ni=teclado.nextInt();
       System.out.println("Número Final: " );
       nf=teclado.nextInt();
       i=ni+1;
       while (i<nf)
       {
       c+=1;
       i++;
       
       }       
       System.out.println(" " );
       System.out.println("Cantidad: "+c);

    }
}

PROBLEMA 41



/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package problema41.suma.de.primeros.numeros.naturales.positivos;
import java.util.Scanner;
/**
 *

 */
public class PROBLEMA41SUMADEPRIMEROSNUMEROSNATURALESPOSITIVOS {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       int i, n, s=0;
      
       System.out.println("Número: " );
       Scanner teclado=new Scanner(System.in);
       n=teclado.nextInt();
       i=1;
       while (i<=n)
       {
       s=s+i;
       i=i+1;
       
       }       
       System.out.println(" " );
       System.out.println("Suma: "+s);

    }
}

miércoles, 22 de abril de 2015

propu_1



package propuesto1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTO1 {

    public static void main(String[] args) throws IOException {
     
        int a,b,s,r;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("a: ");
 a=Integer.parseInt(in.readLine());//ojo
  System.out.println("b: ");
 b=Integer.parseInt(in.readLine());//ojo
 s=a+b;
 System.out.println("");
 System.out.println("suma:" + s);
 System.out.println();
 r=a-b;
  System.out.println("");
 System.out.println("Resta:" + r);
 System.out.println();
    }
}

propu_2




package propuesta2;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTA2 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int  a=150 , b=-78 ;
        int totalenteros;
               BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("ingresar a: ");
 a=(int)Integer.parseInt(in.readLine());//ojo
  System.out.println("ingresar b: ");
  b=(int)Integer.parseInt(in.readLine());//ojo
  
 totalenteros=a-b-1;
 
 System.out.println("");
  System.out.println("el total de enteros entre"+a+"y "+b+" es:"+totalenteros);
 System.out.println();
    
    }
}

propu_3




package propuesto3;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class PROPUESTO3 {
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int total_milimetros = 159999;
        int metros,decimetros,centimetros;
            BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("ingresar  total_milimetros: ");
 total_milimetros=Integer.parseInt(in.readLine());//ojo
   
metros=total_milimetros/1000;
decimetros=(total_milimetros%1000)/10;
centimetros=(total_milimetros%1000)%10;
System.out.println("");
  System.out.println(+total_milimetros+"milimetros, expresado en metros,decimetros y centimetros es : " +metros+"metros");
System.out.println(+decimetros+"decimetros"+centimetros+"y centimetros");
System.out.println();
    }
}

propu_4




package propuesto4;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class PROPUESTO4 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int a=(int) 6.0 , b=(int) 8.0;
        int c,d,factor1;
           BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
            System.out.println("ingresar a:");
       a=(int)Integer.parseInt(in.readLine());//ojo
         System.out.println("ingresar b:");
      b=(int)Integer.parseInt(in.readLine());//ojo

 c=(int) ((4*Math.pow(a,4)+3*a*b+Math.pow(b,2))/(Math.pow(a,2)-Math.pow(b,2)));
 factor1 = (int) (3*(Math.pow(c,2))+a+b);
  d=factor1/4;
   System.out.println("");
  System.out.println("el valor de c es:"+c+" y el valor de d es :"+d);
   System.out.println();
  
    }
}

propu_5



/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesto5;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author User
 */
public class PROPUESTO5 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int a=80 , b=33 , c=20 , d=5 , suma;
        suma=a+b+c+d;
        //si suma ----100%
        //variable(a,b,c,d)--x%,entonces:variable(a,b,c,d)=valor*100/suma
                BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
   System.out.println("ingresar a: ");
 a=(int)Integer.parseInt(in.readLine());//ojo
        int porcentaje_a=(int)(a*100)/(int)suma;
        porcentaje_a=(porcentaje_a*1000)/1000;
   System.out.println("ingresar b: "); 
 b=(int)Integer.parseInt(in.readLine());//ojo
        int porcentaje_b=(int)(b*100)/(int)suma;
          porcentaje_b=(porcentaje_b*1000)/1000;
   System.out.println("ingresar c: ");
 c=(int)Integer.parseInt(in.readLine());//ojo
         int porcentaje_c=(int)(c*100)/(int)suma;
        porcentaje_c=(porcentaje_c*1000)/1000;
   System.out.println("ingresar d: ");
 d=(int)Integer.parseInt(in.readLine());//ojo
        int porcentaje_d=(int)(d*100)/(int)suma;
         porcentaje_d=(porcentaje_d*1000)/1000;       
 System.out.println("");
  System.out.println("la variable\"a\"representa el:"+porcentaje_a+"% de"+suma);
   System.out.println("la variable\"b\"representa el:"+porcentaje_b+"% de"+suma);
   System.out.println("la variable\"c\"representa el:"+porcentaje_c+"% de"+suma);
   System.out.println("la variable\"d\"representa el:"+porcentaje_d+"% de"+suma);
 System.out.println();
        
    }
}

propu_6



package propuesto6;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTO6 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
          
 int lado=5;
 int perimetro,area;
  BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("perimetro: ");
 perimetro=(int) Integer.parseInt(in.readLine());//ojo
  System.out.println("area: ");
 area=(int) Integer.parseInt(in.readLine());//ojo
 
 perimetro=5*4;
 area=(int) Math.pow(lado,2);
 
 System.out.println("");
 System.out.println("el perimetro del cuadrado de lado "+lado+"es"+perimetro+"y su area es"+area);
 System.out.println();
    }
}

propu_7




/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesta7;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author User
 */
public class PROPUESTA7 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
               
     int MINUTO=60;
     int SEGUNDO=3600;
     
     int c,m,s;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Cantidad de horas: ");
 c=Integer.parseInt(in.readLine());//ojo
 
 m=(c * MINUTO);
 s=(c % MINUTO)-c;
 c=(s * SEGUNDO);
 c=(s % SEGUNDO);

 
 System.out.println("");
  System.out.println("Minutos:" + m);
   System.out.println("Segundos:" + s);
 System.out.println();
    }
}

propu_8




package propuesto.pkg8;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTO8 {
   

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        
        int f = 50;
        
      
        float c,k;
        
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Introduz Grados fahrenheit para su conversión");
  c=Integer.parseInt(in.readLine());//ojo
       k=Integer.parseInt(in.readLine());//ojo
       
       c=(float) ((f*0.5)-32);
       k=(float) (((f*0.5)-32)+273.15);
       System.out.println("el resultado de grados celsius es:"+c);
       System.out.println("el resultado de grados kelvin es:"+k);
    }
}

propu_9

package propuesta9;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTA9 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int lado1,lado2,area,perimetro;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("ingrese valor del primer lado: ");
 lado1=Integer.parseInt(in.readLine());//ojo
  System.out.println("ingrese valor del segundo lado: ");
 lado2=Integer.parseInt(in.readLine());//ojo
 perimetro=(2*(lado1+lado2));
 area=(lado1*lado2);
 System.out.println("el perimetro es:"+perimetro);
 System.out.println("el area es:"+area);
    }
}

propu_10




package propuesta10;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTA10 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
         int S,C;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("ingresar los grados sexagesimales: ");
 S=Integer.parseInt(in.readLine());//ojo
 
 C=((200*S)/180);
  System.out.println("los grados centesimales es :"+C);

    }
}

propu_11


package propuesto.pkg11;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTO11 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
         int e;
            String r="";
         BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
         System.out.print("Edad:");
          e=Integer.parseInt(in.readLine());//ojo;
            //PROCESO
            if(e>=18){
                  r="MAYOR DE EDAD";
            }
            if(e<18){
                  r="MENOR DE EDAD";
            }
            //SALIDA
            System.out.println("");
            System.out.println("LA PERSONA ES "+r);
    }
}

propu_12


package propuesta12;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class PROPUESTA12 {

 
    public static void main(String[] args) throws IOException {
       
               int n1, n2, me=0;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero 1: ");
 n1=(int) Integer.parseInt(in.readLine());//ojo
 System.out.println("Numero 2: ");
  n2=(int) Integer.parseInt(in.readLine());//ojo
if(n1<n2)
    me=n1;
if(n2<n1)
  me=n2;
 System.out.println("");
 System.out.println("Menor:" + me);
 System.out.println();
    }
}

propu_13


public class PROPUESTO13 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
      int a,b;
            String S;
            BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
            System.out.print("Primer numero:");
             a=Integer.parseInt(in.readLine());//ojo
            System.out.print("Segundo numero:");
             b=Integer.parseInt(in.readLine());//ojo
             if (a==b){
                  S="Iguales";
            }else{
                  S="Diferentes";
            }
            System.out.println("");
            System.out.println("Son:"+S);
         
    }
}

propu_14




package propuesta.pkg14;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTA14 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int a,r;
            
            BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
            System.out.print("Escribir numero:");
             a=Integer.parseInt(in.readLine());//ojo
              if (a>0){
                  r=a*2;
            }else{
            if (a<0){
                  r=a*3;
            }else{
                  r=0;
            }
            }
               System.out.println("");
            System.out.println("Resultado:"+r);
            

    }
}

propu_15


package propuesta15;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTA15 {

    public static void main(String[] args) throws IOException {
       
           int n1,n2,n3,menor,inter,mayor;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero 1: ");
 n1= Integer.parseInt(in.readLine());//ojo
 System.out.println("Numero 2: ");
 n2=Integer.parseInt(in.readLine());//ojo
 System.out.println("Numero 3: ");
 n3= Integer.parseInt(in.readLine());//ojo
 if(n1 < n2 && n1 < n3)
 {
     menor=n1;
 }
 else
 {
     if (n2 < n1 && n2< n3)
     {
         menor=n2;
     }
         else
     {
         menor=n3;
         }
 }
 if(n1 > n2 && n1 > n3)
 {
     mayor=n1;
 }
 else
 {
     if (n2 > n1 && n2 > n3)
     {
         mayor=n2;
     }
     else
     {
         mayor=n3;
     }
 }
 inter=(n1 + n2 + n3)- (menor + mayor);
 System.out.println("");
 System.out.println("Menor:" + menor);
  System.out.println("Inter:" + inter);
   System.out.println("Mayor:" + mayor);
    System.out.println("Mayor:" + mayor);
  System.out.println("Inter:" + inter);
   System.out.println("Menor:" + menor);
 System.out.println();
 }
}

propu_16


package propuesta.pkg16;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTA16 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int a,b,c,d,PROMEDIO=0;
            String M;
            BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
            System.out.print("Primera nota:");
             a=Integer.parseInt(in.readLine());//ojo
             System.out.print("Segunda nota:");
             b=Integer.parseInt(in.readLine());//ojo
             System.out.print("Tercera nota:");
             c=Integer.parseInt(in.readLine());//ojo
             System.out.print("Cuarta nota:");
             d=Integer.parseInt(in.readLine());//ojo
              if(a<b && a<c && a<d){
                  PROMEDIO=(b+c+d)/3;
            }else{
                  if (b<a && b<c && b<d){
                       PROMEDIO=(a+c+d)/3;
                  }else{
                       if (c<a && c<b && c<d){
                             PROMEDIO=(a+b+d)/3;
                       }else{
                             PROMEDIO=(a+b+c)/3;
                       }
                  }
            }
            if(PROMEDIO>=15){
                  M="Aprobado";
            }else{
                  M="Desaprobado";
                  }
             System.out.println("");
            System.out.println("Resultado:"+PROMEDIO);
            System.out.println("Mensaje:"+M);
           
    }
}

propu_17



package propuesta.pkg17;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTA17 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int sa,mt,sactual=0;
            float tm;
            BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
            System.out.print("ingrese saldo :");
             sa=Integer.parseInt(in.readLine());//ojo
             System.out.print("ingrese tipo de movimiento:");
             tm=Integer.parseInt(in.readLine());//ojo
             System.out.print("ingrese monto:");
             mt=Integer.parseInt(in.readLine());//ojo
             if(tm== 1){
                  sactual = sa - mt;
            }else{
                  if(tm== 2){
                       sactual = sa + mt;
                  }
            }
           
            System.out.print("el saldo actual es:"+sactual);
           
           
    }
}

propu_18



package propuesta.pkg18;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTA18 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int A,B;
            String C = "";
            BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
            System.out.print("PRIMER NUMERO:");
             A=Integer.parseInt(in.readLine());//ojo
            System.out.print("SEGUNDO NUMERO:");
             B=Integer.parseInt(in.readLine());//ojo
             if(A>B){
                  C = "A Es Mayor que B";
            }else{
                  if(B>A){
                     C = "B Es Mayor que A";
                  }
            }
            if(A==B){
                  C = "A Es igual a B";
                  }
            System.out.println("RESULTADO: " +C);
    }
}

martes, 21 de abril de 2015

e_25


package ejercicio25;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO25 {

    public static void main(String[] args) throws IOException {
       int h,m,s;
               BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Hora: ");
 h= Integer.parseInt(in.readLine());//ojo
 System.out.println("Minuto: ");
 m=Integer.parseInt(in.readLine());//ojo
 System.out.println("Segundo: ");
 s= Integer.parseInt(in.readLine());//ojo

 s+=1;
 if (s==60)
 {
     s=0;
     m+=1;
     if(m==60)
     {
        m=0;
        h+=1;
        if(h==24)
     {
         h=0;
        }
     }
  }
    System.out.println("");
 System.out.println("Hora:" + h);
  System.out.println("Minuto:" + m);
   System.out.println("Segundo:" + s);
 System.out.println();
 
    }
}

e_24


package ejercicio24;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO24 {

    public static void main(String[] args) throws IOException {
        double a,b,c,d,x1,x2;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("a: ");
 a=(double) Integer.parseInt(in.readLine());//ojo
 System.out.println("b: ");
 b=(double)Integer.parseInt(in.readLine());//ojo
 System.out.println("c: ");
 c=(double) Integer.parseInt(in.readLine());//ojo

 d=Math.pow(b,2.0)-4.0*c;
 if(a!=0 && d>=0)
 {
     x1=(-b+Math.pow(d,(1.0/2.0)))/2*a;
     x2=(-b-Math.pow(d,(1.0/2.0)))/2*a;
 }
 else
 {
     x1=0;
     x2=0;
  }
  System.out.println("");
 System.out.println("x1:" + x1);
  System.out.println("x2:" + x2);
 System.out.println();
    }
}

e_23


package ejercicio23;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO23 {
    public static void main(String[] args) throws IOException {
      float a,b,x;
       BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("a: ");
 a=Integer.parseInt(in.readLine());//ojo
  System.out.println("b: ");
 b=Integer.parseInt(in.readLine());//ojo

 if(a!=0)
 {
     x=-b/a;
 }
 else
 {
     x=0;
 }
 System.out.println("");
 System.out.println("x:" + x);
 System.out.println();
    }
}

e_22


package ejercicio22;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO22 {

    public static void main(String[] args) throws IOException {
 
    float DESC_G=0.15f;
    float DESC_A=0.2F;
    float REC_G=0.1F;
    float REC_A=0.05F;
   
    float mc,m,tp;
    char tc,fp;
    String r;
    BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Monto de compra: ");
 mc=(float) Integer.parseInt(in.readLine());//ojo
 System.out.println("Tipo de cliente: ");
 tc=(char)Integer.parseInt(in.readLine());//ojo
 System.out.println("Forma de pago: ");
 fp=(char) Integer.parseInt(in.readLine());//ojo

 if(tc=='G')
 {
     if(fp=='C')
     {
         m=mc*DESC_G;
         tp=mc-m;
         r="DESCUENTO 15&";
     }
     else
        {
           m=mc*REC_G;
           tp=mc+m;
           r="RECARGO 10%";
      }
  }
 else
  {
     if (fp=='C')
     {
         m=mc* DESC_A;
         tp=mc-m;
         r="DESCUENTO 20%";
     }
     else
     {
         m=mc*REC_A;
         tp=mc+m;
         r="RECARGO 5%";
     }
 }
     System.out.println("");
 System.out.println(r+ ":"+m);
   System.out.println("Total a pagar:" + tp);
 System.out.println();          
    }
}

e_21



package ejercicio21;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO21 {

    public static void main(String[] args) throws IOException {
       int t;
       String c;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero: ");
 t=Integer.parseInt(in.readLine());//ojo
 if (t<10)
 {
     c="FRIO";
 }
 else
 {
     if (t>10 && t <=20)
     {
         c="NUBLADO";
     }
     else
     {
         if (t>=21 && t<=30)
         {
             c="CALOR";
         }
         else
         {
             c="TROPICAL";
         }
     }
 }
       System.out.println("");
       System.out.println("Clima:" + c);
       System.out.println();
    }
}

e_20


package ejercicio20;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO20 {
    public static void main(String[] args) throws IOException {
          float D1=0.1F;
        float D2=0.2F;
        float  D3=0.3F;
        float IGV=0.19F;
        float c,m_d, m_igv, p;
     BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Consumo: ");
 c=(float)Integer.parseInt(in.readLine());//ojo
 if(c>=200)
 {
     m_d=c*D3;
 }
 else
 {
     if(c>100)
     {
     m_d=c*D2;
     }
     else
     {
         m_d=c*D1;
     }
 }
 m_igv=(c-m_d) * IGV;
 p=c-m_d+m_igv;
  System.out.println("");
 System.out.println("Monto descuento:" + m_d);
  System.out.println("Impuesto IGV:" + m_igv);
   System.out.println("Importe a pagar:" + p);
 System.out.println();
    }
}

e_19


package ejercicio19;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO19 {

    public static void main(String[] args) throws IOException {
     
        float D1=0.1F;
        float D2=0.2F;
        float IGV=0.19F;
        float c,m_d, m_igv, p;
     BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Consumo: ");
 c=(float)Integer.parseInt(in.readLine());//ojo
 if(c<=100)
 {
     m_d=c*D1;
 }
 else
 {
     m_d=c*D2;
 }
 m_igv=(c-m_d) * IGV;
 p=c-m_d+m_igv;
  System.out.println("");
 System.out.println("Monto descuento:" + m_d);
  System.out.println("Impuesto IGV:" + m_igv);
   System.out.println("Importe a pagar:" + p);
 System.out.println();
   }
}

e_18



package ejercicio18;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO18 {
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int n1,n2,n3,mayor,inter,menor;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero 1: ");
 n1= Integer.parseInt(in.readLine());//ojo
 System.out.println("Numero 2: ");
 n2=Integer.parseInt(in.readLine());//ojo
 System.out.println("Numero 3: ");
 n3= Integer.parseInt(in.readLine());//ojo
 if(n1 > n2 && n1 > n3)
 {
     mayor=n1;
 }
 else
 {
     if (n2 > n1 && n2> n3)
     {
         mayor=n2;
     }
         else
     {
         mayor=n3;
         }
 }
 if(n1 < n2 && n1 < n3)
 {
     menor=n1;
 }
 else
 {
     if (n2 < n1 && n2 < n3)
     {
         menor=n2;
     }
     else
     {
         menor=n3;
     }
 }
 inter=(n1 + n2 + n3)- (mayor + menor);
 System.out.println("");
 System.out.println("Mayor:" + mayor);
  System.out.println("Inter:" + inter);
   System.out.println("Menor:" + menor);
 System.out.println();
    }
}

e_17


package ejercicio17;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO17 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int n,r;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero: ");
 n=Integer.parseInt(in.readLine());//ojo
 if (!(n%2==0))
 {
     r=n*2;
 }
 else
 {
     r=n*3;
 }
  System.out.println("");
 System.out.println("Resultado:" + r);
 System.out.println();
  }
}

e_16


package ejercicio16;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO16 {
 public static void main(String[] args) throws IOException {
 int n1,n2,n3,m;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero 1: ");
 n1= Integer.parseInt(in.readLine());//ojo
 System.out.println("Numero 2: ");
 n2=Integer.parseInt(in.readLine());//ojo
 System.out.println("Numero 3: ");
 n3= Integer.parseInt(in.readLine());//ojo
 if (n1>n2)
 {
     if(n1>n3)
     {
         m=n1;
     }
     else
     {
         m=n3;
     }
 }
 else
 {
     if(n2>n3)
     {
         m=n2;
     }
     else
     {
         m=n3;
     }
 }
 System.out.println("");
 System.out.println("Mayor:" + m);
 System.out.println();
    }
}

e_15


package ejercicio15;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO15 {

 
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int n;
        String r;
         BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero: ");
 n=Integer.parseInt(in.readLine());//ojo
 if(n%2==0)
 {
     r="PAR";
 }
 else
 {
     r="IMPAR";
 }
  System.out.println("");
 System.out.println("Resultado:" + r);
 System.out.println();
 }
}

e_14


package ejercicio14;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO14 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int n;
        String r;
         BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero: ");
 n=Integer.parseInt(in.readLine());//ojo
 if(n%3==0 && n%5==0)
 {
     r="SI ES MULTIPLO DE 3 Y 5";
 }
else
 {
     r="NO ESMULTIPLO DE 3 Y 5";
 }
  System.out.println("");
 System.out.println("Resultado:" + r);
 System.out.println();
  }
}

e_13




package ejercicio13;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO13 {
   
    public static void main(String[] args) throws IOException {
 char c;
 String r="";

 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Caracter: ");
 c= (char) Integer.parseInt(in.readLine());//ojo

 r="NO ES VOCAL";

 if(c=='a'||c=='A')
 {
     r="ES VOCAL";
 }
if(c=='e'||c=='E' )
{
    r="ES VOCAL";
}
if(c=='i'|| c=='I')
{
    r="ES VOCAL";
}
if (c=='o'|| c=='O')
{
    r="ES VOCAL";
}
if (c== 'u'|| c=='U')
{
    r="ES VOCAL";
}
 System.out.println("");
 System.out.println("Resultado:" + r);
 System.out.println();
    }
}
       

e_12

package ejercicio12;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class EJERCICIO12 {
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
     int n;
     String r="";
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero: ");
 n=(int)Integer.parseInt(in.readLine());//ojo
 if (n>0)
 {
     r="POSITIVO";
    }
 if (n<0)
 {
     r="NEGATIVO";
 }
 if(n==0)
 {
     r="NEUTRO";
 }
  System.out.println("");
 System.out.println("Resultado:" + r);
 System.out.println();
     
    }
}

e_11


package ejercicio11;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO11 {

 
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int n1, n2, m=0;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero 1: ");
 n1=(int) Integer.parseInt(in.readLine());//ojo
 System.out.println("Numero 2: ");
  n2=(int) Integer.parseInt(in.readLine());//ojo
if(n1>n2)
    m=n1;
if(n2>n1)
  m=n2;
 System.out.println("");
 System.out.println("Mayor:" + m);
 System.out.println();
     
    }
}

e_10


package ejercicio10;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO10 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
     int HORA=3600;
     int MINUTO=60;
   
     int t,h,m,s;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Tiempo en segundos: ");
 t=(int)Integer.parseInt(in.readLine());//ojo
 h=t / HORA;
 t=t % HORA;
 m=t / MINUTO;
 s=t % MINUTO;
 System.out.println("");
 System.out.println("Horas:" + h);
  System.out.println("Minutos:" + m);
   System.out.println("Segundos:" + s);
 System.out.println();
     
    }
}

e_09



package ejercicio9;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO9 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
  float PI=3.14159F;
   float a,r;
  BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Radio: ");

 r=(float) Integer.parseInt(in.readLine());//ojo
 a=(float)(PI *(Math.pow((double)r,2.0)));

 System.out.println("");
 System.out.println("Area:" + a);
 System.out.println();
     
    }
}

e_08



package ejercicio8;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO8 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        float c,r,t,i,m;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Capital: ");
 c=(float) Integer.parseInt(in.readLine());//ojo
 System.out.println("Tasa de interes: ");
 r=(float) Integer.parseInt(in.readLine());//ojo
 System.out.println("Tiempo: ");
 t=(float) Integer.parseInt(in.readLine());//ojo

 m=(float)(Math.pow((double)(1+r/100),(double) t))*c;
 i= m-c;
 System.out.println("");
 System.out.println("Interes:" + i);
  System.out.println("Monto:" + m);
 System.out.println();
        
    }
}

e_07



package ejercicio7;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class EJERCICIO7 {

 
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
      int n,s;
          BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero: ");
 n=Integer.parseInt(in.readLine());//ojo
 s=(n*(n+1))/2;
 System.out.println("");
 System.out.println("Suma:" + s);
 System.out.println();
     
    }
}

e_06



package ejercicio6;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class EJERCICIO6 {
public static void main(String[] args) throws IOException {
  int n,ni,r;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Numero: ");
 n= Integer.parseInt(in.readLine());//ojo
 r=n%10;
 n=n/10;
 ni=r*10;
 r=n%10;
 n=n/10;
 ni=(ni+r)*10;
 r=n%10;
 n=n/10;
 ni=(ni+r)*10;
 r=n%10;
 n=n/10;
 ni=(ni+r)*10;
 ni=ni+n;
 System.out.println("");
 System.out.println("Inverso:" + ni);
 System.out.println();
 }
}

e_05


package ejercicio5;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class EJERCICIO5 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int a;
        short n, r;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("a: ");
 a=(int) Integer.parseInt(in.readLine());//ojo
  System.out.println("n: ");
   n=(short) Integer.parseInt(in.readLine());//ojo
 r=(short)Math.pow((double)a,(1/(double) n));
 System.out.println("");
 System.out.println("Radicacion:" + r);
 System.out.println();
     
    }
}

e_04



package ejercicio4;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class EJERCICIO4 {


    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        short a,n;
        int p;
BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("a: ");
 a=(short) Integer.parseInt(in.readLine());//ojo
  System.out.println("n: ");
   n=(short) Integer.parseInt(in.readLine());//ojo
 p=(int)Math.pow((double)a,(double) n);
 System.out.println("");
 System.out.println("Potencia:" + p);
 System.out.println();
     
    }
}

e_03




package ejercicio3;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class EJERCICIO3 {

 
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        float vv,igv,pv;
             BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Valor de venta: ");
 vv=Integer.parseInt(in.readLine());//ojo
 igv=vv*0.19F;
 pv=vv+igv;
 System.out.println("");
 System.out.println("Igv:" + igv);
  System.out.println("Precio de venta:" + pv);
 System.out.println();
     
    }
}

e_02



package ejercicio2;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class EJERCICIO2 {

 
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int n1,n2,c,r;
        BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("numero 1: ");
 n1=Integer.parseInt(in.readLine());//ojo
  System.out.println("numero 2: ");
 n2=Integer.parseInt(in.readLine());//ojo
 c=n1/n2;
 r=n1%n2;
 System.out.println("");
 System.out.println("Cociente:" + c);
  System.out.println("Residuo:" + r);
 System.out.println();
    }
}