Golang專案之函式版學生管理系統

2022-07-05 06:54:10 字數 485 閱讀 2082

學習第3天,基於函式的方式編寫小專案:學生管理系統

package main

import (

"fmt"

"os")/*

函式版學生管理系統

寫乙個系統能夠檢視所有的學生/新增學生/刪除學生

*/var (

allstudent map[int64]*student // 變數宣告

)type student struct

// newstudent是乙個student型別的建構函式

func newstudent(id int64,name string)*student

}func showallstudent()

} else

}func addstudent()else

}func deletestudent()else

}func main()

}}

學生管理系統 函式版

import time import os 定乙個列表,用來儲存所有的學生資訊 每個學生是乙個字典 info list def print menu print print 學生管理系統 v1.0 print 1 新增學生 print 2 刪除學生 print 3 修改學生 print 4 查詢學生...

go 學生管理系統(函式版)

最近在學習 go,通過go 編寫了乙個簡單的學生資訊管理系統,附上 如下 package main import fmt os math 函式版學生管理系統 1.檢視,新曾,刪除 建立存放所有學生元素的 map var allstud map int64 student type student s...

Golang 練習1 書籍管理 函式版

package main import fmt os 使用函式實現乙個簡單的圖書管理系統 每本書有書名,作者,備註 使用者可以在控制台新增,修改書籍資訊,列印所有書籍列表 type book struct func newbook title,author,price string book 建立乙...