diff options
| author | Paulo Custodio <pauloscustodio@gmail.com> | 2023-03-20 22:05:03 +0000 |
|---|---|---|
| committer | Paulo Custodio <pauloscustodio@gmail.com> | 2023-03-20 22:05:03 +0000 |
| commit | 24768e7e03a6650db1d81f58ec120b806807fc0f (patch) | |
| tree | 2cbcb17c809bc117110c190641a0ecf542639d31 | |
| parent | 05a0862dc464bcdda8eaca308559334c2a4faebc (diff) | |
| download | perlweeklychallenge-club-24768e7e03a6650db1d81f58ec120b806807fc0f.tar.gz perlweeklychallenge-club-24768e7e03a6650db1d81f58ec120b806807fc0f.tar.bz2 perlweeklychallenge-club-24768e7e03a6650db1d81f58ec120b806807fc0f.zip | |
incomplete
| -rw-r--r-- | challenge-209/paulo-custodio/basic/ch-2.bas | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/challenge-209/paulo-custodio/basic/ch-2.bas b/challenge-209/paulo-custodio/basic/ch-2.bas index b73570d522..96447e2b53 100644 --- a/challenge-209/paulo-custodio/basic/ch-2.bas +++ b/challenge-209/paulo-custodio/basic/ch-2.bas @@ -68,14 +68,24 @@ sub split(byval text as string, delim as string = " ", ret() as string) loop end sub -function common_email(byref a as integer, byref b as integer) as boolean +function common_email(byref aa as integer, byref bb as integer) as boolean dim emails_a() as string, emails_b() as string - dim i as integer, j as integer, k as integer - for i=0 to ubound(names) - split(emails(i),,emails_a()) - print names(i);" "; - for j=0 to ubound(emails_a): print emails_a(j);" ";: next - print + dim a as integer, i as integer, b as integer, j as integer + for a=0 to ubound(names) + split(emails(a),,emails_a()) + for i=0 to ubound(emails_a) + for b=0 to ubound(names) + if a<>b then + split(emails(b),,emails_b()) + for j=0 to ubound(emails_b) + if mails_a(i)=mails_b(j) then + aa=a: bb=b: common_email=true + exit function + end if + next + end if + next + next next common_email=false end function |
