Advertisement
Spocoman

AND Processors

Sep 28th, 2024
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.56 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     "math"
  6. )
  7.  
  8. func main() {
  9.     const  workingHoursPerDay = 8
  10.     const processorBuildHours = 3
  11.     const processorPrice = 110.10
  12.  
  13.     var neededProcessors, workers, days int
  14.     fmt.Scanln(&neededProcessors)
  15.     fmt.Scanln(&workers)
  16.     fmt.Scanln(&days)
  17.    
  18.     diff := float64(neededProcessors - workers * days * workingHoursPerDay / processorBuildHours) * processorPrice
  19.  
  20.     if diff > 0 {
  21.         fmt.Printf("Losses: -> %.2f BGN\n", diff)
  22.     } else {
  23.         fmt.Printf("Profit: -> %.2f BGN\n", math.Abs(diff))
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement