Score
0
Watch 25 Star 104 Fork 12

Gitee星球的小活动 / 第 0 届 代码编故事接力赛

Join us
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
让我们点燃程序员写作之魂,一人用代码写一段故事玩玩吧~ spread retract

Clone or download
考试的故事-go 1.17 KB
Copy Edit Web IDE Raw Blame History
Kui_Ye authored 2020-03-24 17:35 . add 考试的故事-go.
package main
import (
"fmt"
"os"
"time"
)
type story struct {
times int64
local string
student student
}
type persion struct {
say string
name string
}
type student struct {
score int
persionstudent persion
}
type teacher struct{
persionteacher persion
}
func main() {
mystory:=story{}
mystory.times= time.Now().Unix() //这是一个现在发生的故事
my:=student{}
my.persionstudent.name="小明"//我叫小明
my.score=58 //我考了58分
fmt.Println("我叫",my.persionstudent.name)
fmt.Println("我考了",my.score,"分")
laoshi:=teacher{}
fmt.Println("我去找了老师")
laoshi.persionteacher.name="赵老师"
my.persionstudent.say=laoshi.persionteacher.name+",帮帮我把" //我请求老师让我过
fmt.Println("我说:"+my.persionstudent.say)
askTime:=60*60*2
for i :=0;i!=askTime;i=i+1{
fmt.Fprintf(os.Stdout,"央求老师 %d 次\r",i) //我请求了两个小时
time.Sleep(time.Second*1)
}
laoshi.persionteacher.say="ok" //老师说好吧
fmt.Println("老师说"+laoshi.persionteacher.say)
my.score++
fmt.Println("最后,我的成绩是 ",my.score)
}
// 接下来的就看你们的了

Comment ( 0 )

Sign in for post a comment

1
https://gitee.com/Selected-Activities/Code-relay.git
git@gitee.com:Selected-Activities/Code-relay.git
Selected-Activities
Code-relay
第 0 届 代码编故事接力赛
master

Help Search

220309 7019f5b6 1899542 220318 4015cbb9 1899542