Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- const workingHoursPerDay = 8
- const processorBuildHours = 3
- const processorPrice = 110.10
- var neededProcessors, workers, days int
- fmt.Scanln(&neededProcessors)
- fmt.Scanln(&workers)
- fmt.Scanln(&days)
- diff := float64(neededProcessors - workers * days * workingHoursPerDay / processorBuildHours) * processorPrice
- if diff > 0 {
- fmt.Printf("Losses: -> %.2f BGN\n", diff)
- } else {
- fmt.Printf("Profit: -> %.2f BGN\n", math.Abs(diff))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement