Foo Bar Qix

Write a program that prints numbers from 1 to 100, one number per line. For each printed number, use the following rules :

Example:

  • 1
  • 2
  • FooFoo
  • 4
  • BarBar
  • Foo
  • QixQix
  • 8
  • Foo
  • Bar

mathieu.ancelin@serli.com

  • divisors have high precedence, ex: 51 -> FooBar
  • the content is analysed in the order they appear, ex: 53 -> BarFoo
  • 13 contains 3 so we print "Foo"
  • 15 is divisible by 3 and 5 and contains 5, so we print "FooBarBar"
  • 33 contains 3 two times and is divisible by 3, so we print "FooFooFoo"