Advertisement
Spocoman

Oscars

Oct 11th, 2024
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.93 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.   "fmt"
  5.   "bufio"
  6.   "os"
  7.   "strconv"
  8. )
  9.  
  10. func main() {
  11.     scanner := bufio.NewScanner(os.Stdin)
  12.     scanner.Scan()
  13.     name := scanner.Text()
  14.    
  15.     scanner.Scan()
  16.     points,_ := strconv.ParseFloat(scanner.Text(), 64)
  17.    
  18.     scanner.Scan()
  19.     juryNum,_ := strconv.Atoi(scanner.Text())
  20.    
  21.     judgeName := ""
  22.     judgePoints := 0.0
  23.    
  24.     for i := 0; i < juryNum; i++ {
  25.         scanner.Scan()
  26.         judgeName = scanner.Text()
  27.        
  28.         scanner.Scan()
  29.         judgePoints,_ = strconv.ParseFloat(scanner.Text(), 64)
  30.        
  31.         points += float64(len(judgeName)) * judgePoints / 2
  32.         if points > 1250.5 {
  33.             break
  34.         }
  35.     }
  36.  
  37.     if points > 1250.5 {
  38.         fmt.Printf("Congratulations, %s got a nominee for leading role with %.1f!\n", name, points)
  39.     } else {
  40.         fmt.Printf("Sorry, %s you need %.1f more!\n", name, 1250.5 - points)
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement