Category Archives: Project Euler

Solution to Project 22 on Project Euler

The problem: — Using names.txt (right click and ‘Save Link/Target As…’), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score. For example, when the […]

Solution to Problem 19 on Project Euler

The problem: You are given the following information, but you may prefer to do some research for yourself. 1 Jan 1900 was a Monday. Thirty days has September, April, June and November. All the rest have thirty-one, Saving February alone, Which has twenty-eight, rain or shine. And on leap years, twenty-nine. A leap year occurs […]

Solution to Problem 15 on ProjectEuler.net

The problem: ——- Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner. How many routes are there through a 2020 grid? ——- My Solution #include <stdio.h> int main(){   int i,j,x,y;   long long int mat[21][21];   i=0;   for (j=0;j<21;j++)     mat[i][j]=1;   j=0;   for (i=0;i<21;i++)     mat[i][j]=1;   for […]