Advertisement
Niemampomyslu

Untitled

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