Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Simplified palindrome test using stack
//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) { Stack<char> stack = new Stack<char>(); string input = "qwertysytrewq"; input = input.ToUpper(); foreach (char c in input) { stack.Push(c); } bool flag = true; foreach (char c in input) { if (c != stack.Pop()) { flag = false; break; } } Console.WriteLine(flag); } } }
run
|
edit
|
history
|
help
0
Konsol Üçgen Çizimi
Main3-2
3
Problem3 Binary
Typeing
Numbers in Interval Dividable by Given Number
Games
FindSmallest
Putting In-Between Symbols
SHA Tester 2.1