Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Threading;
- using System.IO;
- using System.Collections;
- namespace ConsoleApplication5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int lastPalindromes = 0;
- for(int x = 100; x < 999; x++)
- {
- for (int y = 100; y < 999; y++)
- {
- int mul = x * y;
- if (isPalindromes(mul))
- {
- lastPalindromes = mul;
- }
- }
- }
- Console.WriteLine(lastPalindromes);
- Console.ReadLine();
- }
- static bool isPalindromes(int integer)
- {
- string s_i = integer.ToString();
- string s2_i = new string(s_i.Reverse().ToArray());
- return s_i == s2_i;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement