标签:func sharp for one ack details als note pack
1.家庭记账本
package main import "fmt" func main() { key:=""; loop:=true; detail:="收支\t账户余额\t收支金额\t说明"; money:=0.0; banacle:=1000.00; notes:=""; details:=""; for { fmt.Println("\n-------------------家庭收支记账软件-----------------------"); fmt.Println(" 1.收支明细"); fmt.Println(" 2.登记收入"); fmt.Println(" 3.登记支出"); fmt.Println(" 4.退出软件"); fmt.Println("请选择(1-4):"); fmt.Scanln(&key); switch key { case "1": fmt.Println("本次收入:"); fmt.Scanln(&money); banacle=banacle+money;//收入 fmt.Println("收入来源是:"); fmt.Scanln(¬es); fmt.Println("-------------------收支明细记录-----------------------"); fmt.Println(detail); //detailstr:="收入\t%v\t%v\t%v"; details+=fmt.Sprintf("\n收入%12v\t%10v\t%12v",banacle,money,notes); fmt.Println(details); case "2": fmt.Println("this is 2"); case "3": fmt.Println("这是登记支出"); case "4": loop=false; } if !loop { break; } } }
标签:func sharp for one ack details als note pack
原文地址:https://www.cnblogs.com/zh718594493/p/14059914.html