Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- "strconv"
- )
- func main() {
- var x, y, nonPaint, paint int
- fmt.Scanln(&x)
- fmt.Scanln(&y)
- fmt.Scanln(&nonPaint)
- neededPaint := 1.0 * x * y * 4 * (100.0 - nonPaint) / 100
- var command string
- fmt.Scanln(&command)
- for command != "Tired!" {
- paint,_ = strconv.Atoi(command)
- neededPaint -= paint
- if neededPaint <= 0 {
- break
- }
- fmt.Scanln(&command)
- }
- if neededPaint > 0 {
- fmt.Printf("%d quadratic m left.\n", neededPaint)
- } else if neededPaint == 0 {
- fmt.Println("All walls are painted! Great job, Pesho!")
- } else {
- fmt.Printf("All walls are painted and you have %d l paint left!\n", int(math.Abs(float64(neededPaint))))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement