Advertisement
Spocoman

PC Store

Oct 12th, 2024
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.50 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     const USDToBGN float64 = 1.57
  7.    
  8.     var processorPrice, videoPrice, ramPrice float64
  9.     fmt.Scanln(&processorPrice)
  10.     fmt.Scanln(&videoPrice)
  11.     fmt.Scanln(&ramPrice)
  12.    
  13.     var ramCount int
  14.     fmt.Scanln(&ramCount)
  15.    
  16.     var discount float64
  17.     fmt.Scanln(&discount)
  18.    
  19.     sum := ((processorPrice + videoPrice) * (1 - discount) + ramPrice * float64(ramCount)) * USDToBGN
  20.  
  21.     fmt.Printf("Money needed - %.2f leva.\n", sum)
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement