Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // GRUPA D ZADANIE 1 PESEL
- //
- public class App {
- public static int[] Pesel(String tab[][]) {
- int [] odp = new int[tab.length];
- int wartosc=0;
- int pes = 0;
- for(int i=0;i<tab.length;i++) {
- for(int j =0; j<tab[i].length;j++) {
- wartosc = Integer.parseInt(String.valueOf(tab[i][0].charAt(j)));
- if(j == 1 || j ==5 || j==10) {
- wartosc = wartosc * 3;
- }
- else if(j==2 || j==6) {
- wartosc = wartosc * 7;
- }
- else if(j==3 || j==7) {
- wartosc = wartosc * 9;
- }
- pes =+ wartosc;
- }if(pes % 10 ==0) {
- tab[i][1] ="POPRAWNY";
- }else tab[i][1] = "BLEDNY";
- }
- return odp;
- }
- public static void main(String[] args) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement