Chicken or egg

Report a typo

It's an old philosophical problem: what was there before — a chicken or an egg? Let's try to answer!

Sample Input 1:

1903 12 28
1912 6 23

Sample Output 1:

Chicken is first!
Write a program in Go
package main

import (
"fmt"
"time"
)

func main() {
var year, month, day int

// Chicken born time:
fmt.Scan(&year, &month, &day)
chicken := time.Date(?, time.Month(month), ?, 0, 0, 0, 0, time.UTC)

// Egg born time:
fmt.Scan(&year, &?, ?)
egg := time.Date(?, ?, ?, 0, 0, 0, 0, time.UTC)

switch {
case chicken.Before(?):
fmt.Println("Chicken is first!")
case chicken.?(egg):
fmt.Println("Egg is first!")
default:
fmt.Println("Time collapsed")
}
}
___

Create a free account to access the full topic