Advertisement
Spocoman

Series Calculator

Oct 13th, 2024
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.58 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "bufio"
  5.     "fmt"
  6.     "os"
  7.     "strconv"
  8. )
  9.  
  10. func main() {
  11.     scanner := bufio.NewScanner(os.Stdin)
  12.     scanner.Scan()
  13.     series := scanner.Text()
  14.    
  15.     scanner.Scan()
  16.     season,_ := strconv.Atoi(scanner.Text())
  17.    
  18.     scanner.Scan()
  19.     volume,_ := strconv.Atoi(scanner.Text())
  20.    
  21.     scanner.Scan()
  22.     time,_ := strconv.ParseFloat(scanner.Text(), 64)
  23.  
  24.     minutes := float64(season * volume) * time * 1.2 + float64(season) * 10
  25.  
  26.     fmt.Printf("Total time needed to watch the %s series is %d minutes.", series, int(minutes))
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement