Advertisement
Spocoman

Grandpa Stavri

Oct 10th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.71 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var days int
  7.     fmt.Scanln(&days)
  8.    
  9.     var currentLiters, currentGradus, averageGradus, totalLiters float64
  10.  
  11.     for i := 0; i < days; i++ {
  12.         fmt.Scanln(&currentLiters)
  13.         fmt.Scanln(&currentGradus)
  14.         averageGradus += currentLiters * currentGradus
  15.         totalLiters += currentLiters
  16.     }
  17.  
  18.     averageGradus /= totalLiters
  19.  
  20.     fmt.Printf("Liter: %.2f\nDegrees: %.2f\n", totalLiters, averageGradus)
  21.  
  22.     if averageGradus < 38 {
  23.         fmt.Println("Not good, you should baking!")
  24.     } else if averageGradus > 42 {
  25.         fmt.Println("Dilution with distilled water!")
  26.     } else {
  27.         fmt.Println("Super!")
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement