Permalink
Browse files

finished problem 25

  • Loading branch information...
1 parent f3d1146 commit 7872357cc2b8fef42dca79115a00408fe9bf9918 @finsterdexter committed Jan 6, 2012
Showing with 156 additions and 0 deletions.
  1. +58 −0 Euler025/Euler025.csproj
  2. +50 −0 Euler025/Program.cs
  3. +36 −0 Euler025/Properties/AssemblyInfo.cs
  4. +12 −0 ProjectEuler.sln
View
58 Euler025/Euler025.csproj
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{1870409D-9229-4AF2-BA82-C063FC995070}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Euler025</RootNamespace>
+ <AssemblyName>Euler025</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Numerics" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
View
50 Euler025/Program.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Numerics;
+using System.Diagnostics;
+
+namespace Euler025
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ MethodOne();
+ }
+
+ private static void MethodOne()
+ {
+ Stopwatch timer = Stopwatch.StartNew();
+ List<BigInteger> fib = new List<BigInteger>();
+ fib.Add(new BigInteger(1));
+ fib.Add(new BigInteger(1));
+
+ while (fib.Last().ToString().Length < 1000)
+ {
+ fib.Add(fib.Last() + fib[fib.Count - 2]);
+ }
+
+ Console.WriteLine("F sub {0}: {1}", fib.Count, fib.Last().ToString());
+ Console.WriteLine("{0}ms", timer.ElapsedMilliseconds);
+ Console.ReadLine();
+ }
+
+ // from http://projecteuler.net/thread=25;page=8
+ private static void MethodTwo()
+ {
+ var startTime = DateTime.Now;
+
+ var golden = (1 + Math.Sqrt(5)) / 2;
+
+ var pos = (1000 + (Math.Log10(5) / 2) - 1) / Math.Log10(golden);
+
+ Console.WriteLine(string.Format("Position = {0}", Math.Round(pos, 0)));
+
+ Console.WriteLine(string.Format("TimeTaken: {0}ms", (DateTime.Now - startTime).Milliseconds));
+
+ Console.ReadKey();
+ }
+ }
+}
View
36 Euler025/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Euler025")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Administrator")]
+[assembly: AssemblyProduct("Euler025")]
+[assembly: AssemblyCopyright("Copyright © Administrator 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7f7412c0-519e-4dec-a7e5-0c60edb67bf6")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
View
12 ProjectEuler.sln
@@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Euler009", "Euler009\Euler0
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Euler010", "Euler010\Euler010.csproj", "{41669E64-78CF-4D95-BBD0-11B58BE0523E}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Euler025", "Euler025\Euler025.csproj", "{1870409D-9229-4AF2-BA82-C063FC995070}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -145,6 +147,16 @@ Global
{41669E64-78CF-4D95-BBD0-11B58BE0523E}.Release|Mixed Platforms.Build.0 = Release|x86
{41669E64-78CF-4D95-BBD0-11B58BE0523E}.Release|x86.ActiveCfg = Release|x86
{41669E64-78CF-4D95-BBD0-11B58BE0523E}.Release|x86.Build.0 = Release|x86
+ {1870409D-9229-4AF2-BA82-C063FC995070}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {1870409D-9229-4AF2-BA82-C063FC995070}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {1870409D-9229-4AF2-BA82-C063FC995070}.Debug|Mixed Platforms.Build.0 = Debug|x86
+ {1870409D-9229-4AF2-BA82-C063FC995070}.Debug|x86.ActiveCfg = Debug|x86
+ {1870409D-9229-4AF2-BA82-C063FC995070}.Debug|x86.Build.0 = Debug|x86
+ {1870409D-9229-4AF2-BA82-C063FC995070}.Release|Any CPU.ActiveCfg = Release|x86
+ {1870409D-9229-4AF2-BA82-C063FC995070}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {1870409D-9229-4AF2-BA82-C063FC995070}.Release|Mixed Platforms.Build.0 = Release|x86
+ {1870409D-9229-4AF2-BA82-C063FC995070}.Release|x86.ActiveCfg = Release|x86
+ {1870409D-9229-4AF2-BA82-C063FC995070}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

0 comments on commit 7872357

Please sign in to comment.