Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- String[][] pesele = new String[2][2];
- pesele[0][0] = "99110907619";
- pesele[0][1] = "PRAWDA";
- pesele[1][0] = "99110907619";
- pesele[1][1] = "PRAWDA";
- PESEL(pesele);
- }
- public static long[] PESEL(String[][] tab){
- long []zwrot = new long[tab.length];
- for(int i=0;i<tab.length;i++){
- long peselint = Long.parseLong(tab[i][0]);
- long k = peselint%10;
- peselint =(peselint - k)/10;
- long j = peselint%10;
- peselint =(peselint - j)/10;
- long ii = peselint%10;
- peselint =(peselint - i)/10;
- long h = peselint%10;
- peselint =(peselint - h)/10;
- long g = peselint%10;
- peselint =(peselint - g)/10;
- long f = peselint%10;
- peselint =(peselint - f)/10;
- long e = peselint%10;
- peselint =(peselint - e)/10;
- long d = peselint%10;
- peselint =(peselint - d)/10;
- long c = peselint%10;
- peselint =(peselint - c)/10;
- long b = peselint%10;
- peselint =(peselint - b)/10;
- long a = peselint%10;
- long poprawne = a+3*b+7*c+9*d+e+3*f+7*g+9*h+i+3*j+k;
- if(poprawne%10 == 0)
- {
- tab[i][1]="Poprawny";
- }else
- {
- tab[i][1]="Bledny";
- }
- System.out.println(""+a+b+c+d+e+f+g+h+ii+j+k);
- System.out.println(tab[i][1]);
- zwrot[i]=poprawne;
- }
- return zwrot;
- }
Add Comment
Please, Sign In to add comment