Browse Source

👌 IMPROVE

fixDevirged
zainabdnaya 2 years ago committed by zainab Dnaya
parent
commit
40ca316ba0
  1. 12
      subjects/countstars/README.md

12
subjects/countstars/README.md

@ -1,15 +1,21 @@
## CountStars ## CountStars
### Instructions ### Instructions
Write a function named `CountStar` that makes you fall asleep by counting stars, it takes an integer in the parameter Write a function called CountStars that counts the stars up to a number given as an argument.
- If the number is negative or equal to 0, return "`No star`" - If the number is negative or equal to 0, return "`No stars`"
- No need to manage overflow. - No need to manage overflow.
### Expected Function
```go ```go
func CountStars(num int) string { func CountStars(num int) string {
} }
``` ```
### Usage
Here is a possible program to test your function :
```go ```go
import ( import (
"fmt" "fmt"
@ -28,6 +34,6 @@ func main() {
$ go run . $ go run .
1 star...2 stars...3 stars...4 stars...5 stars 1 star...2 stars...3 stars...4 stars...5 stars
1 star...2 stars...3 stars...4 stars 1 star...2 stars...3 stars...4 stars
No star No stars
1 star 1 star
``` ```

Loading…
Cancel
Save