Голы Месси

Messages
1,608
Reaction score
288
Website
tehadm.ru
С переводом заданий туго))). Поэтому выкладываю оригинал задания:
Messi is a soccer player with goals in three leagues:
  • LaLiga
  • Copa del Rey
  • Champions
Complete the function to return his total number of goals in all three leagues.

Note: the input will always be valid.
Пример:
5, 10, 2 --> 17

C-like:
func Goals(laLigaGoals, copaDelReyGoals, championsLeagueGoals int) int {
  // your code
}

Простым языком: подается три числа. Надо с помощью функции вернуть их сумму.
 
Last edited:
C-like:
package main

import (
    "fmt"
)

func main() {
    var laLigaGoals, copaDelReyGoals, championsLeagueGoals int
    fmt.Scan(&laLigaGoals, &copaDelReyGoals, &championsLeagueGoals)

    fmt.Println(Goals(laLigaGoals, copaDelReyGoals, championsLeagueGoals))
}

func Goals(laLigaGoals, copaDelReyGoals, championsLeagueGoals int) int {
    return laLigaGoals + copaDelReyGoals + championsLeagueGoals
}
 
Back
Top