Advertisement
Spocoman

Easter Bake

Oct 7th, 2024
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.69 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.   "fmt"
  5.   "math"
  6. )
  7.  
  8. func main() {
  9.     var quantity, sugar, flour, maxSugar, maxFlour, totalSugar, totalFlour int
  10.     fmt.Scanln(&quantity)
  11.  
  12.     for i := 0; i < quantity; i++ {
  13.         fmt.Scanln(&sugar)
  14.         fmt.Scanln(&flour)
  15.         if maxSugar < sugar {
  16.             maxSugar = sugar
  17.         }
  18.         if maxFlour < flour {
  19.             maxFlour = flour
  20.         }
  21.         totalSugar += sugar
  22.         totalFlour += flour
  23.     }
  24.  
  25.     fmt.Printf("Sugar: %d\nFlour: %d\nMax used flour is %d grams, max used sugar is %d grams.\n",
  26.                 int(math.Ceil(float64(totalSugar) / 950)), int(math.Ceil(float64(totalFlour) / 750)), maxFlour, maxSugar)
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement