Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Project Euler Problem 4
//Rextester.Program.Main is the entry point for your code. Don't change it //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int i, j, n, max_n = 0; for (i = 100; i<= 999; i++) { for (j = 100; j <= 999; j++) { n = i * j; if ( n > max_n && IsPalendrome(n) ) { max_n = n; } } } //Your code goes here Console.WriteLine("The solution is: " + max_n); } public static bool IsPalendrome (int n) { string forward_string, reverse_string; forward_string = n.ToString(); reverse_string = new string(forward_string.ToCharArray().Reverse().ToArray()); return forward_string == reverse_string ? true : false; } } }
run
|
edit
|
history
|
help
0
Strings Mix Complete
Raise Meldings logikk
get weekofDay from DateTime in C#
QLSV
Day1
sorted array
struc t
Evo Ivana da budes fancy :D
C# program to Determine if Two Words Are Anagrams of Each Other
Print Matrix To Screen (with little pretty box)