Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Numer Pesel, składający się dokładnie z 11 cyfr stanowi identyfikator pozycji w rejestrze,
- w systemie ewidencji ludności Polski. Ostatnia cyfra numeru Pesel jest cyfrą kontrolną, pozwalającą na sprawdzenie poprawności numeru.
- Napisz program, który pozwoli na sprawdzanie poprawności numerów Pesel.
- */import java.util.Scanner;
- import java.lang.Integer;
- public class WeryfikacjaPesel
- {
- public static void main(String[] args)
- {
- ?? numer;
- Scanner sc = new Scanner(System.in);
- System.out.print("Wprowadz numer pesel (11 cyfr): ");
- String numerPesel = sc.nextInt();
- //obliczenia
- ??? numer = 1*numerPesel.substring(1) + 3*numerPesel.substring(2) + 7*numerPesel.substring(3) + 9*numerPesel*substring(4) + 1*numerPesel.substring(5) +
- 3*numerPesel.substring(6) + 7*numerPesel.substring(7) + 9*numerPesel.substring(8) + 1*numerPesel.substring(9) + 3*numerPesel.substring(10) +
- 1*numerPesel.substring(11);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement