سلام بر برنامه نویسان عزیز ایران زمین 😉 در این مطلب کد Push و pop مقدار در generic Stack در سی شارپ را آماده کردم. انشاالله که این کد براتون مفید باشه.
خروجی این کد به صورت زیر می باشد:
Five Four Three Two One
کد Push و pop مقدار در generic Stack در سی شارپ :
using System;
using System.Collections.Generic;
class MainClass {
public static void Main() {
Stack<string> st = new Stack<string>();
st.Push("One");
st.Push("Two");
st.Push("Three");
st.Push("Four");
using System.Collections.Generic;
class MainClass {
public static void Main() {
Stack<string> st = new Stack<string>();
st.Push("One");
st.Push("Two");
st.Push("Three");
st.Push("Four");