SlideShare a Scribd company logo
1 of 5
/*System.out.println(""Una nota"");

    System.out.println("Hola Mundo");

    String i ="4";

     System.out.println("El valor de i es: "+i);

     System.out.println(i);

     int n = 12;

     char x ='w';

     System.out.println(n);

     System.out.println("El valor de x es: " + x);

     double j = 1.0 / 2.0;

     System.out.print("j es: ");

     System.out.println(j);

     int h = 0;

     int e = 2;

     while(h <= 10)

     {

         System.out.println(++h);

         if(h != 2 && h != 4 && h%2 == 0)

         {
break;

         }

     }

     String p = (h == 4)? "Listo":"Fallo";

     System.out.println(p);

     BufferedReader datosEntrantes = new BufferedReader( new
InputStreamReader(System.in) );

     String nombre = "";

     System.out.println("Escribe tu nombre, Por Favor!!");

     try

     {

         nombre = datosEntrantes.readLine();

     }

     catch (IOException ex)

     {

         Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);

         System.out.println("Error!!");

     }

     System.out.println("Hola " + nombre + "!!");

     int[] a= new int [10];
a[0] = 7;

a[1] = 9;

a[2] = 6;

a[3] = 3;

a[4] = 1;

a[5] = 8;

a[6] = 2;

a[7] = 4;

a[8] = 5;

a[9] = 0;

for(int g =0; g < a.length - 1 ; g++)

{

    System.out.println("La posicion " +(g + 1) +" es igual a ="+ a[g]);

}

for(int k = 0; k < a.length -1; k++)

{

    int min = k;

    for(int l = k + 1;l < a.length; l++)

    {
if(a[l] < a[min])

        {

            min = l;

            System.out.println("0");

        }

        System.out.println("a");

    }

    if(k != min)

    {

        int aux = a[k];

        a[k] = a[min];

        a[min] = aux;

        System.out.println("b");

    }

    System.out.println("c");

}

System.out.println("");

for(int m = 0;m < a.length;m++)

{
System.out.println("La posicion " +(m+1) +" es igual a = "+ a[m]);

}*/

More Related Content

What's hot (20)

Bubble sort
Bubble sortBubble sort
Bubble sort
 
C Program : Sorting : Bubble,
C Program : Sorting : Bubble, C Program : Sorting : Bubble,
C Program : Sorting : Bubble,
 
C language program
C language programC language program
C language program
 
Selection
SelectionSelection
Selection
 
Simulacion - Algoritmo congruencial cuadratico
Simulacion - Algoritmo congruencial cuadraticoSimulacion - Algoritmo congruencial cuadratico
Simulacion - Algoritmo congruencial cuadratico
 
Dij
DijDij
Dij
 
Vcs19
Vcs19Vcs19
Vcs19
 
Dasar c
Dasar cDasar c
Dasar c
 
Tgs ppt alpro no.3
Tgs ppt alpro no.3Tgs ppt alpro no.3
Tgs ppt alpro no.3
 
Base datos
Base datosBase datos
Base datos
 
Corridas
CorridasCorridas
Corridas
 
Info clasa
Info clasaInfo clasa
Info clasa
 
Sockets java
Sockets javaSockets java
Sockets java
 
Trabajo de programacion
Trabajo de programacionTrabajo de programacion
Trabajo de programacion
 
Python codigo graficas
Python codigo graficasPython codigo graficas
Python codigo graficas
 
Infitopost notepad
Infitopost   notepadInfitopost   notepad
Infitopost notepad
 
Import java
Import javaImport java
Import java
 
Macro
MacroMacro
Macro
 
Java осень 2012 лекция 6
Java осень 2012 лекция 6Java осень 2012 лекция 6
Java осень 2012 лекция 6
 
Play fair cipher
Play fair cipherPlay fair cipher
Play fair cipher
 

Novatadas en java

  • 1. /*System.out.println(""Una nota""); System.out.println("Hola Mundo"); String i ="4"; System.out.println("El valor de i es: "+i); System.out.println(i); int n = 12; char x ='w'; System.out.println(n); System.out.println("El valor de x es: " + x); double j = 1.0 / 2.0; System.out.print("j es: "); System.out.println(j); int h = 0; int e = 2; while(h <= 10) { System.out.println(++h); if(h != 2 && h != 4 && h%2 == 0) {
  • 2. break; } } String p = (h == 4)? "Listo":"Fallo"; System.out.println(p); BufferedReader datosEntrantes = new BufferedReader( new InputStreamReader(System.in) ); String nombre = ""; System.out.println("Escribe tu nombre, Por Favor!!"); try { nombre = datosEntrantes.readLine(); } catch (IOException ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); System.out.println("Error!!"); } System.out.println("Hola " + nombre + "!!"); int[] a= new int [10];
  • 3. a[0] = 7; a[1] = 9; a[2] = 6; a[3] = 3; a[4] = 1; a[5] = 8; a[6] = 2; a[7] = 4; a[8] = 5; a[9] = 0; for(int g =0; g < a.length - 1 ; g++) { System.out.println("La posicion " +(g + 1) +" es igual a ="+ a[g]); } for(int k = 0; k < a.length -1; k++) { int min = k; for(int l = k + 1;l < a.length; l++) {
  • 4. if(a[l] < a[min]) { min = l; System.out.println("0"); } System.out.println("a"); } if(k != min) { int aux = a[k]; a[k] = a[min]; a[min] = aux; System.out.println("b"); } System.out.println("c"); } System.out.println(""); for(int m = 0;m < a.length;m++) {
  • 5. System.out.println("La posicion " +(m+1) +" es igual a = "+ a[m]); }*/