模拟窗口售票(Go语言实现)
摘要:
package mainimport( "fmt" "math/rand" "runtime" "time")var total_ticket chan int //define a channel to reserve the count of the ticketfunc sell(i int){//the params i represents the window number for { count := <- total_ticket if count > 0{ time.Sle... 阅读全文
posted @ 2012-12-20 15:27 lxy15329 阅读(322) 评论(0) 推荐(0)
浙公网安备 33010602011771号