Skip to content

Instantly share code, notes, and snippets.

@shieldsd
Created March 22, 2012 09:36
Show Gist options
  • Save shieldsd/2157352 to your computer and use it in GitHub Desktop.
Save shieldsd/2157352 to your computer and use it in GitHub Desktop.
Project Euler #19
#!/bin/ksh
count=0
for year in {1901..2000}; do
for month in {1..12}; do
if cal $month $year | cut -b1,2 | grep ' 1' > /dev/null; then
((count = $count + 1))
fi
done
done
echo $count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment