Files

13 lines
619 B
Markdown

# 01 — Podstawy Go (`:=`, `if`, `switch`, `for`, multiple return values)
## Zadania (`basics.go`)
1. `CelsiusToFahrenheit(c float64) float64` — $F = C \cdot 1.8 + 32$.
2. `ClassifyScore(score int) string` — `switch` bez warunku: `0..49` -> `"fail"`, `50..74` -> `"pass"`, `75..89` -> `"good"`, `90..100` -> `"excellent"`, inaczej `"invalid"`.
3. `SumUpTo(n int) int` — suma `1..n` włącznie (dla `<= 0` zwróć `0`).
4. `DivMod(a, b int) (int, int, bool)` — zwróć `(iloraz, reszta, true)` lub `(0, 0, false)` przy `b == 0`.
## Uruchomienie testów
```bash
make test PKG=./exercises/01-core/01-basics
```