Robert and Andrew are two men, and Mary and Jessica are two women. Their last names are Jones, Smith, Coleman, and Thompson. One of them has a dog, one has a cat, one has a bird, and one has a rabbit. The pets are named Goody, Lovey, Lucky, and Weirdo.
1. Robert's pet's name starts with L.
2. Jessica Coleman has a cat, but it is not named Weirdo.
3. Mary does not have a dog because she hates dogs.
4. Lucky is a rabbit.
5. Mr. Jones has a bird.
6. Mary's last name is not Thompson.
7. Weirdo's last name is not Jones.
What is the first name and last name of each person? What pet does each person have? What is the name of each pet?
Same Answer - more ancient tongue
program pet
implicit none
integer p(4,24),f,s,a,n,in
character*1 ff(4),ss(4),aa(4),nn(4)
data ff,ss,aa,nn/
1 'R','A','M','J','J','S','C','T','d','c','b','r','G','L','u','W'/
data p/
5 4,1,2,3, 1,4,2,3, 1,2,4,3, 1,2,3,4, 4,2,3,1, 2,4,3,1,
5 2,3,4,1, 2,3,1,4, 4,3,1,2, 3,4,1,2, 3,1,4,2, 3,1,2,4,
5 4,3,2,1, 3,4,2,1, 3,2,4,1, 3,2,1,4, 4,2,1,3, 2,4,1,3,
5 2,1,4,3, 2,1,3,4, 4,1,3,2, 1,4,3,2, 1,3,4,2, 1,3,2,4/
do 3 s=1,24
if(p(4,s).ne.3.or.p(3,s).eq.4)go to 3 ! 2a, 6
if(p(3,s).eq.1.or.p(4,s).eq.1)go to 3 ! 5a
do 2 a=1,24
if(p(3,a).eq.1.or.p(4,a).ne.2)go to 2 ! 3, 2b
do 1 n=1,24
if(p(1,n).ne.2.and.p(1,n).ne.3)go to 1 ! 1
if(p(4,n).eq.4)go to 1 ! 2c
do in=1,4
if(p(in,n).eq.3.and.p(in,a).ne.4)go to 1 ! 4
if(p(in,s).eq.1.and.p(in,a).ne.3)go to 1 ! 5b
if(p(in,s).eq.1.and.p(in,n).eq.4)go to 1 ! 7
enddo
print*
print 10,(ff(f),ss(p(f,s)),aa(p(f,a)),nn(p(f,n)),f=1,4)
10 format(4a1)
1 enddo
2 enddo
3 enddo
end
lord@rabbit 13669 % pet
RJbL
ATdW
MSru
JCcG