Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "bufio"
- "os"
- "strconv"
- )
- func main() {
- scanner := bufio.NewScanner(os.Stdin)
- scanner.Scan()
- name := scanner.Text()
- scanner.Scan()
- points,_ := strconv.ParseFloat(scanner.Text(), 64)
- scanner.Scan()
- juryNum,_ := strconv.Atoi(scanner.Text())
- judgeName := ""
- judgePoints := 0.0
- for i := 0; i < juryNum; i++ {
- scanner.Scan()
- judgeName = scanner.Text()
- scanner.Scan()
- judgePoints,_ = strconv.ParseFloat(scanner.Text(), 64)
- points += float64(len(judgeName)) * judgePoints / 2
- if points > 1250.5 {
- break
- }
- }
- if points > 1250.5 {
- fmt.Printf("Congratulations, %s got a nominee for leading role with %.1f!\n", name, points)
- } else {
- fmt.Printf("Sorry, %s you need %.1f more!\n", name, 1250.5 - points)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement