-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exercício: Capítulo 13, Exercício 3 (Nível: 6) #43
Labels
Comments
fui no simples tbm: https://play.golang.org/p/LdHBH5qIZ5J |
https://play.golang.org/p/jygLUCmMqd_s
Output
|
my solution: package main
import "fmt"
func main() {
a := 10
b := 50
x := a + b
defer fmt.Print(x)
fmt.Print("O resultado da soma de A + B é: ")
} |
package main
import "fmt"
func main() {
defer fmt.Println("Acabou a contagem, obrigado a todos os envolvidos")
x := 10
fmt.Println("Vamos contar até", x, "!")
for i := 1; i <= 10; i++ {
fmt.Println(i)
}
} |
Cap. 13 – Exercícios: Nível #6 – 3 |
package main
import "fmt"
func main() {
slice := []int{2, 3, 5}
defer fmt.Println("vem depois da soma")
fmt.Println(somaDeVariadico(slice...))
}
func somaDeVariadico(variadico ...int) int {
total := 0
for _, v := range variadico {
total += v
}
return total
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Exercício: Capítulo 13, Exercício 3 (Nível: 6)
Use esta thread para compartilhar sua solução, discutir o exercício com os colegas e pedir ajuda caso tenha dificuldades!
The text was updated successfully, but these errors were encountered: