From dc76a3aa38f6700f6d0dc6973aba7c1069c52734 Mon Sep 17 00:00:00 2001 From: zainabdnaya Date: Fri, 17 Jun 2022 19:28:56 +0100 Subject: [PATCH] feat: subject strisnegative --- subjects/strisnegative/README.md | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 subjects/strisnegative/README.md diff --git a/subjects/strisnegative/README.md b/subjects/strisnegative/README.md new file mode 100644 index 000000000..edd8299a7 --- /dev/null +++ b/subjects/strisnegative/README.md @@ -0,0 +1,41 @@ +## isnegative + +Write a function named `IsNegative()` that defines if a number (You should check if it's a number) is negative or positive. +- Your function print `P` if the number is positive +- Your function print `F` if the number is negative +- For the number is zero print `0`. +- If it's not a number print newline. +- Your program should always print `('\n') `at the end of the output. + +### Expected function +```go +func StrisNegative(str string) { + +} +``` + +### Usage + +Here is a possible program to test your function : + +```go +package main + +import "piscine" + +func main() { + piscine.StrisNegative("585") + piscine.StrisNegative("-58") + piscine.StrisNegative("55s44") +} +``` + +And its output : + +```console +$ go run . +P +N +! +``` +