From 88ea4eb3a46a4c254dc38af44382a61f9de58794 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Sun, 27 Oct 2019 23:53:41 +0330 Subject: [PATCH 01/21] Add files via upload --- C#/.gitattributes | 63 ++++++ C#/.gitignore | 340 +++++++++++++++++++++++++++++++ C#/2. Even Fibonacci numbers.sln | 25 +++ 3 files changed, 428 insertions(+) create mode 100644 C#/.gitattributes create mode 100644 C#/.gitignore create mode 100644 C#/2. Even Fibonacci numbers.sln diff --git a/C#/.gitattributes b/C#/.gitattributes new file mode 100644 index 0000000..b7d4ef6 --- /dev/null +++ b/C#/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/C#/.gitignore b/C#/.gitignore new file mode 100644 index 0000000..fbf9197 --- /dev/null +++ b/C#/.gitignore @@ -0,0 +1,340 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb \ No newline at end of file diff --git a/C#/2. Even Fibonacci numbers.sln b/C#/2. Even Fibonacci numbers.sln new file mode 100644 index 0000000..acb5ad5 --- /dev/null +++ b/C#/2. Even Fibonacci numbers.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29403.142 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2. Even Fibonacci numbers", "2. Even Fibonacci numbers\2. Even Fibonacci numbers.csproj", "{B013E8E0-A897-4F45-9F1D-AF14AADBB898}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B013E8E0-A897-4F45-9F1D-AF14AADBB898}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B013E8E0-A897-4F45-9F1D-AF14AADBB898}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B013E8E0-A897-4F45-9F1D-AF14AADBB898}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B013E8E0-A897-4F45-9F1D-AF14AADBB898}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {11495E8A-2B38-4742-87F4-4E943EA9C337} + EndGlobalSection +EndGlobal From 0d23bbb2c2b5150393af63552a742d58dd2ffcc4 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Sun, 27 Oct 2019 23:54:26 +0330 Subject: [PATCH 02/21] Delete 2. Even Fibonacci numbers.sln --- C#/2. Even Fibonacci numbers.sln | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 C#/2. Even Fibonacci numbers.sln diff --git a/C#/2. Even Fibonacci numbers.sln b/C#/2. Even Fibonacci numbers.sln deleted file mode 100644 index acb5ad5..0000000 --- a/C#/2. Even Fibonacci numbers.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29403.142 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2. Even Fibonacci numbers", "2. Even Fibonacci numbers\2. Even Fibonacci numbers.csproj", "{B013E8E0-A897-4F45-9F1D-AF14AADBB898}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B013E8E0-A897-4F45-9F1D-AF14AADBB898}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B013E8E0-A897-4F45-9F1D-AF14AADBB898}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B013E8E0-A897-4F45-9F1D-AF14AADBB898}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B013E8E0-A897-4F45-9F1D-AF14AADBB898}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {11495E8A-2B38-4742-87F4-4E943EA9C337} - EndGlobalSection -EndGlobal From 434d066b5a0fd6d5dbc2ee4e9225df12eb54fac7 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Sun, 27 Oct 2019 23:54:38 +0330 Subject: [PATCH 03/21] Delete .gitignore --- C#/.gitignore | 340 -------------------------------------------------- 1 file changed, 340 deletions(-) delete mode 100644 C#/.gitignore diff --git a/C#/.gitignore b/C#/.gitignore deleted file mode 100644 index fbf9197..0000000 --- a/C#/.gitignore +++ /dev/null @@ -1,340 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- Backup*.rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb \ No newline at end of file From 48ce8c555201b2f8c5555ceb31f18dd6f8b0f054 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Sun, 27 Oct 2019 23:54:48 +0330 Subject: [PATCH 04/21] Delete .gitattributes --- C#/.gitattributes | 63 ----------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 C#/.gitattributes diff --git a/C#/.gitattributes b/C#/.gitattributes deleted file mode 100644 index b7d4ef6..0000000 --- a/C#/.gitattributes +++ /dev/null @@ -1,63 +0,0 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### -* text=auto - -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp - -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain From d0397845987cd59c556427bfa1605ef1a644f2a8 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Sun, 27 Oct 2019 23:58:10 +0330 Subject: [PATCH 05/21] create EvenFiboNumbers for Q2 --- C#/EvenFiboNumbers.cs | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 C#/EvenFiboNumbers.cs diff --git a/C#/EvenFiboNumbers.cs b/C#/EvenFiboNumbers.cs new file mode 100644 index 0000000..813577d --- /dev/null +++ b/C#/EvenFiboNumbers.cs @@ -0,0 +1,48 @@ +using System; +namespace _2._Even_Fibonacci_numbers +{ + class EvenFiboNumbers + { + static int evenFibSum(int limit) + { + if (limit < 2) + return 0; + + // Initialize first two even + // prime numbers and their sum + long ef1 = 0, ef2 = 2; + long sum = ef1 + ef2; + + // calculating sum of even + // Fibonacci value + while (ef2 <= limit) + { + + // get next even value of + // Fibonacci sequence + long ef3 = 4 * ef2 + ef1; + + // If we go beyond limit, + // we break loop + if (ef3 > limit) + break; + + // Move to next even number + // and update sum + ef1 = ef2; + ef2 = ef3; + sum += ef2; + } + + return (int)sum; + } + + // Driver code + public static void Main() + { + int limit = 4000000; + Console.Write(evenFibSum(limit)); + + } + } +} From 0d966b1b18026f23632cfdfd38e407be46e0d8ad Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 00:18:42 +0330 Subject: [PATCH 06/21] create largest_prime_fac --- C#/largest_prime_fac.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 C#/largest_prime_fac.cs diff --git a/C#/largest_prime_fac.cs b/C#/largest_prime_fac.cs new file mode 100644 index 0000000..e2fdf19 --- /dev/null +++ b/C#/largest_prime_fac.cs @@ -0,0 +1,25 @@ +using System; +namespace largest_prime_fac +{ + class largest_prime_fac + { + public static void Main() + { + long num = 600851475143; + int count = 3; + while (num > 1) + { + if (num % count == 0) + { + num /= count; + } + else + { + count += 2; + } + } + Console.WriteLine("The largest prime factor of the number {0} is {1} ", 600851475143, count); + Console.ReadKey(); + } + } +} From 58ce4a0240eb05fdd0296c7fbe82a70b481cef19 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 00:23:51 +0330 Subject: [PATCH 07/21] Create Largest_palindrome_product --- C#/Largest_palindrome_product | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 C#/Largest_palindrome_product diff --git a/C#/Largest_palindrome_product b/C#/Largest_palindrome_product new file mode 100644 index 0000000..456938e --- /dev/null +++ b/C#/Largest_palindrome_product @@ -0,0 +1,33 @@ +using System; +namespace _Largest_palindrome_product +{ + class Largest_palindrome_product + { + public static void Main() + { + for (int i = 999; i >= 100; i--) + { + for (int j = 999; j >= 100; j--) + { + if (isPalindome(i * j) == true) + { + Console.WriteLine("Digit1: " + i); + Console.WriteLine("Digit2: " + j); + Console.WriteLine("Outcome: " + i * j); + Console.ReadLine(); + } + } + + } + Console.ReadLine(); + } + public static bool isPalindome(int num) + { + string sNum = num.ToString(); + for (int i = 0; i < sNum.Length / 2; i++) + if (sNum[i] != sNum[sNum.Length - 1 - i]) return false; + + return true; + } + } +} From 5f38e9b94d2b080ecc928c17dc561a7777210c17 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 00:41:25 +0330 Subject: [PATCH 08/21] Create Smallest_multiple.cs --- C#/Smallest_multiple.cs | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 C#/Smallest_multiple.cs diff --git a/C#/Smallest_multiple.cs b/C#/Smallest_multiple.cs new file mode 100644 index 0000000..e3f6b4a --- /dev/null +++ b/C#/Smallest_multiple.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace _Smallest_multiple +{ + class Smallest_multiple + { + public static void Main() + { + Console.WriteLine(Calc(20)); + } + static List Factors(int n) + { + List list = new List(); + int i = 2; + while (i <= n) + { + if (n % i == 0) + { + list.Add(i); + n /= i; + } + else + i++; + } + return list; + } + + static int Calc(int n) + { + var factors = Enumerable.Range(2, n - 1).Select(j => Factors(j)).ToList(); + + int i = 2; + int res = 1; + while (i <= n) + { + if (factors.Count(l => l.Contains(i)) > 1) + { + factors.ForEach(l => l.Remove(i)); + res *= i; + } + else + i++; + } + + return res * factors.SelectMany(x => x).Aggregate((s, j) => s *= j); + } + } +} From 411fe658e2b1a793fe3923800c041df7782da773 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 00:47:25 +0330 Subject: [PATCH 09/21] Create Prime_10001st.cs --- C#/Prime_10001st.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 C#/Prime_10001st.cs diff --git a/C#/Prime_10001st.cs b/C#/Prime_10001st.cs new file mode 100644 index 0000000..3b107b7 --- /dev/null +++ b/C#/Prime_10001st.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace _Prime_10001st +{ + class Prime_10001st + { + public static void Main() + { + List primeNumbers = new List() { 2 }; + for (long i = 3; i < long.MaxValue; i += 2) + { + if (!primeNumbers.Any(p => (i % p) == 0)) + { + primeNumbers.Add(i); + if (primeNumbers.Count == 10001) + { + Console.WriteLine(i); + break; + } + } + } + } + } +} From ced6f86eac9b5c2ef02e3503b2aa30b2b2784357 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 11:23:04 +0330 Subject: [PATCH 10/21] Rename EvenFiboNumbers.cs to 02.EvenFiboNumbers.cs --- C#/{EvenFiboNumbers.cs => 02.EvenFiboNumbers.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename C#/{EvenFiboNumbers.cs => 02.EvenFiboNumbers.cs} (100%) diff --git a/C#/EvenFiboNumbers.cs b/C#/02.EvenFiboNumbers.cs similarity index 100% rename from C#/EvenFiboNumbers.cs rename to C#/02.EvenFiboNumbers.cs From 2d4f5b12851eacf095a731bf9f5c88d9f01293a5 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 11:23:33 +0330 Subject: [PATCH 11/21] Rename largest_prime_fac.cs to 03.largest_prime_fac.cs --- C#/{largest_prime_fac.cs => 03.largest_prime_fac.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename C#/{largest_prime_fac.cs => 03.largest_prime_fac.cs} (100%) diff --git a/C#/largest_prime_fac.cs b/C#/03.largest_prime_fac.cs similarity index 100% rename from C#/largest_prime_fac.cs rename to C#/03.largest_prime_fac.cs From b87761290a92c86587619c1225b4d70a286a62ba Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 11:23:54 +0330 Subject: [PATCH 12/21] Rename Largest_palindrome_product to 04.Largest_palindrome_product --- C#/{Largest_palindrome_product => 04.Largest_palindrome_product} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename C#/{Largest_palindrome_product => 04.Largest_palindrome_product} (100%) diff --git a/C#/Largest_palindrome_product b/C#/04.Largest_palindrome_product similarity index 100% rename from C#/Largest_palindrome_product rename to C#/04.Largest_palindrome_product From 75d9ac1adb4eb6e70704a274f0c3b991565ae137 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 11:24:40 +0330 Subject: [PATCH 13/21] Rename Smallest_multiple.cs to 05.Smallest_multiple.cs --- C#/{Smallest_multiple.cs => 05.Smallest_multiple.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename C#/{Smallest_multiple.cs => 05.Smallest_multiple.cs} (100%) diff --git a/C#/Smallest_multiple.cs b/C#/05.Smallest_multiple.cs similarity index 100% rename from C#/Smallest_multiple.cs rename to C#/05.Smallest_multiple.cs From a3fc342af5c78abe284a951033d0e1fded63ad01 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 11:25:01 +0330 Subject: [PATCH 14/21] Rename Prime_10001st.cs to 07.Prime_10001st.cs --- C#/{Prime_10001st.cs => 07.Prime_10001st.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename C#/{Prime_10001st.cs => 07.Prime_10001st.cs} (100%) diff --git a/C#/Prime_10001st.cs b/C#/07.Prime_10001st.cs similarity index 100% rename from C#/Prime_10001st.cs rename to C#/07.Prime_10001st.cs From 66d31e94a0ca774e2ccbe7cc0922825b0574f91c Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 14:29:16 +0330 Subject: [PATCH 15/21] Update 02.EvenFiboNumbers.cs --- C#/02.EvenFiboNumbers.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/C#/02.EvenFiboNumbers.cs b/C#/02.EvenFiboNumbers.cs index 813577d..1f26e76 100644 --- a/C#/02.EvenFiboNumbers.cs +++ b/C#/02.EvenFiboNumbers.cs @@ -1,3 +1,4 @@ +// Project Euler : Problem Number 02 using System; namespace _2._Even_Fibonacci_numbers { From cc034dbb9f51a3bb16362de55007a560720f5978 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 14:30:34 +0330 Subject: [PATCH 16/21] Problem Number 02 in C# --- C#/02.EvenFiboNumbers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C#/02.EvenFiboNumbers.cs b/C#/02.EvenFiboNumbers.cs index 1f26e76..759f27d 100644 --- a/C#/02.EvenFiboNumbers.cs +++ b/C#/02.EvenFiboNumbers.cs @@ -1,4 +1,4 @@ -// Project Euler : Problem Number 02 +// Project Euler : Problem Number02 using System; namespace _2._Even_Fibonacci_numbers { From 0770220372c589c811235f6bc2fe5c7050e51ef3 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 14:31:25 +0330 Subject: [PATCH 17/21] problem03 done in C# --- C#/03.largest_prime_fac.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/C#/03.largest_prime_fac.cs b/C#/03.largest_prime_fac.cs index e2fdf19..e357784 100644 --- a/C#/03.largest_prime_fac.cs +++ b/C#/03.largest_prime_fac.cs @@ -1,3 +1,4 @@ +//Euler problem03 using System; namespace largest_prime_fac { From e3eace71284f8b432db6f7acc4dc890d03adb9fc Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 14:31:56 +0330 Subject: [PATCH 18/21] problem 04 done in C# --- C#/04.Largest_palindrome_product | 1 + 1 file changed, 1 insertion(+) diff --git a/C#/04.Largest_palindrome_product b/C#/04.Largest_palindrome_product index 456938e..5298e29 100644 --- a/C#/04.Largest_palindrome_product +++ b/C#/04.Largest_palindrome_product @@ -1,3 +1,4 @@ +//Euler problem04 using System; namespace _Largest_palindrome_product { From f554f0ef06b0e4270107097ece3d744f4d71727d Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 14:32:25 +0330 Subject: [PATCH 19/21] problem05 done in C# --- C#/05.Smallest_multiple.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/C#/05.Smallest_multiple.cs b/C#/05.Smallest_multiple.cs index e3f6b4a..83c47ff 100644 --- a/C#/05.Smallest_multiple.cs +++ b/C#/05.Smallest_multiple.cs @@ -1,3 +1,4 @@ +//Euler problem05 using System; using System.Collections.Generic; using System.Linq; From c3b33841340455d4632c2803c16344b3576003c8 Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 14:32:50 +0330 Subject: [PATCH 20/21] problem07 done in C# --- C#/07.Prime_10001st.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/C#/07.Prime_10001st.cs b/C#/07.Prime_10001st.cs index 3b107b7..96ed602 100644 --- a/C#/07.Prime_10001st.cs +++ b/C#/07.Prime_10001st.cs @@ -1,3 +1,4 @@ +//Euler problem07 using System; using System.Collections.Generic; using System.Linq; From 25ec087cc6dd44eb62f154679a37469c1cfcf01d Mon Sep 17 00:00:00 2001 From: Prhmma Date: Mon, 28 Oct 2019 15:57:49 +0330 Subject: [PATCH 21/21] problem06 done in C# --- C#/06.Sum_square_difference | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 C#/06.Sum_square_difference diff --git a/C#/06.Sum_square_difference b/C#/06.Sum_square_difference new file mode 100644 index 0000000..c9f0f64 --- /dev/null +++ b/C#/06.Sum_square_difference @@ -0,0 +1,17 @@ +//Euler problem06 +using System; + +public class Sum_square_difference +{ + public static void Main() + { + int n=10; + //sum of square first 100numbers + //1^2+2^2+3^2.... + long sum1=(n*(n+1)*(2*n+1))/6; + //sum of first 100 numbers square + //(1+2+3...)^2 + long sum2=((n*(n+1))/2)*((n*(n+1))/2); + Console.WriteLine(sum2-sum1); + } +}