Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var days int
- fmt.Scanln(&days)
- var currentLiters, currentGradus, averageGradus, totalLiters float64
- for i := 0; i < days; i++ {
- fmt.Scanln(¤tLiters)
- fmt.Scanln(¤tGradus)
- averageGradus += currentLiters * currentGradus
- totalLiters += currentLiters
- }
- averageGradus /= totalLiters
- fmt.Printf("Liter: %.2f\nDegrees: %.2f\n", totalLiters, averageGradus)
- if averageGradus < 38 {
- fmt.Println("Not good, you should baking!")
- } else if averageGradus > 42 {
- fmt.Println("Dilution with distilled water!")
- } else {
- fmt.Println("Super!")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement