Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "bufio"
- "fmt"
- "os"
- "strconv"
- )
- func main() {
- scanner := bufio.NewScanner(os.Stdin)
- scanner.Scan()
- movie := scanner.Text()
- scanner.Scan()
- days,_ := strconv.Atoi(scanner.Text())
- scanner.Scan()
- tickets,_ := strconv.Atoi(scanner.Text())
- scanner.Scan()
- ticketPrice,_ := strconv.ParseFloat(scanner.Text(), 64)
- scanner.Scan()
- percent,_ := strconv.Atoi(scanner.Text())
- price := float64(days) * float64(tickets) * ticketPrice * float64(100 - percent) / 100
- fmt.Printf("The profit from the movie %s is %.2f lv.\n", movie, price)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement