NET中实现了相应的类
Stackusing System;
using System.Collections;
using System.Collections.Generic;public class Hello
(
public static void Main(String[]args){
Stack ds=new Stack();
for(int i=1;i<=10;i++){
ds.Push(i); //进
} while(!ds.Empty()){
Console.WriteLine(ds.Pop()); //出。
}
}
)
Stackusing System;
using System.Collections;
using System.Collections.Generic;public class Hello
(
public static void Main(String[]args){
Stack ds=new Stack();
for(int i=1;i<=10;i++){
ds.Push(i); //进
} while(!ds.Empty()){
Console.WriteLine(ds.Pop()); //出。
}
}
)
Stack<int>ds=new Stack<int>();
for(int i=1;i<10;i++){
ds.Push(i); //进
}//当有数据的话,就打印出来
while(ds.Count>0){
Console.WriteLine(ds.Pop());
}