Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt
- "bufio"
- "os"
- )
- func calcula_nota(nota1 float32) (float32){
- if nota1 < 0 {
- return -1.0
- } else if nota1 > 10 {
- return -1.0
- }
- return (5.0 - 0.4 * nota1) / 0.6
- }
- func main() {
- var nota1 float32
- reader := bufio.NewReader(os.Stdin)
- nota1 = 9.5
- if nota1 < 0 {
- fmt.Println("Tu é burro mêmo em!")
- } else if nota1 > 10 {
- fmt.Println("Tu é o bichão mêmo em doido!")
- }
- fmt.Printf("Você precisa tirar %.2f\n", calcula_nota(nota1))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement