resource main
	import factorial, gl
body main()

	cap factorial  fc 

	op gl.answer myanswer

	fc = create factorial()

	write("A Program to Compute Factorials")
	int  n 
	put("how many numbers?  "); read(n); write()
	int  a[1:n,1:2] 

	write("enter", n, "numbers, separated by whitespace")
	for [ i = 1 to n ] {
		read(a[i,1])
	}

	write()
	for [ i = 1 to n ] {
		send fc.fact(a[i,1],myanswer)
		receive myanswer(a[i,2])
		write(a[i,1], "factorial is", (a[i,2]));
	}

end
