Skip to content

Commit

Permalink
dotnet format
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 19, 2024
1 parent 3283ce3 commit 397a0eb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions csharp/Euler/p0004.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ namespace Euler
{
public class p0004 : IEuler
{
private static string Reverse( string s )
private static string Reverse(string s)
{
char[] charArray = s.ToCharArray();
Array.Reverse(charArray);
return new string(charArray);
}

private static bool IsPalindrome( Int64 x )
private static bool IsPalindrome(Int64 x)
{
string rep = x.ToString();
return rep == Reverse(rep);
Expand All @@ -34,10 +34,13 @@ private static bool IsPalindrome( Int64 x )
public Task<Int64> Answer()
{
Int64 answer = 0;
for (int v = 101; v < 1000; v++) {
for (int u = 100; u < v; u++) {
for (int v = 101; v < 1000; v++)
{
for (int u = 100; u < v; u++)
{
Int64 p = u * v;
if (IsPalindrome(p) && p > answer) {
if (IsPalindrome(p) && p > answer)
{
answer = p;
}
}
Expand Down

0 comments on commit 397a0eb

Please sign in to comment.