• This is default featured slide 1 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by NewBloggerThemes.com.

  • This is default featured slide 2 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by NewBloggerThemes.com.

  • This is default featured slide 3 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by NewBloggerThemes.com.

  • This is default featured slide 4 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by NewBloggerThemes.com.

  • This is default featured slide 5 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by NewBloggerThemes.com.

Validador de RUT

Es una forma sencilla de obtener un rut completo a partir de los dígitos anteriores.
De facil uso ya que el método que obtiene el dígito de control es muy sencillo prácticamente de niños

package validador.rut;
/*
 * v.java
 *
 * Creado en 09/08/2011, 05:58:13 PM
 *
 * Aplicacion creada por jonathan-palomino.blogspot.com.
 *
 */

/**
 *
 * @author Jonathan palomino 
 */
class v {
static String RUT="12345678";
    public static void main(String args[]) {
        int M = 0, S = 1;
        int T = Integer.parseInt(RUT);
        for (; T != 0; T /= 10) {
            S = (S + T % 10 * (9 - M++ % 6)) % 11;
        }
        System.out.println(RUT+"-"+(char) (S != 0 ? S + 47 : 75));
    }
}
Share:

Visitantes

Flag Counter

Popular Posts

Etiquetas

Recent Posts