From c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:08:27 +0200 Subject: add: graphs et rushs --- rushs/tinyprintf/facto/facto.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 rushs/tinyprintf/facto/facto.sh (limited to 'rushs/tinyprintf/facto') diff --git a/rushs/tinyprintf/facto/facto.sh b/rushs/tinyprintf/facto/facto.sh new file mode 100755 index 0000000..350973a --- /dev/null +++ b/rushs/tinyprintf/facto/facto.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +[ $# -ne 1 ] && exit 1 +i=$1 +res=1 +while [ "$i" -gt 0 ]; do + res=$(($res * $i)) + i=$(($i - 1)) +done +echo "$res" -- cgit v1.2.3