Project Euler #4 in C# -
i'm attempting project euler problem #4 in c#. problem i'm having when code runs console window briefly appears , goes away. don't know problem i'm relatively new programming.
using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; namespace consoleapplication1 { class program { static void main(string[] args) { (int = 1000; > 100; i--) (int j = 1000; j > 100; j--) palcheck(i * j); } static void palcheck(int original) { var reversed = new string(convert.tostring(original).tochararray().reverse().toarray()); if (convert.tostring(original) == reversed) console.writeline(original); console.readkey(); } } }
the code seems stuck @ line console.readkey() @ line of code, program waiting input key. since have not used message before readkey(), don't realize program waiting input , not stuck.
move console.readkey() after palcheck(i * j) , should see output on console screen.
Comments
Post a Comment