first question of C

This commit is contained in:
2026-04-22 13:49:33 +02:00
parent 9a1c3cdb71
commit 528de80d51
2 changed files with 10 additions and 8 deletions

View File

@@ -1,12 +1,14 @@
#include <stdio.h>
int main() {
const char *cow = " ^__^\n"
" (oo)\\_______\n"
" (__)\\ )\\/\\\n"
" ||----w |\n"
" || ||\n";
void affiche_vache() {
printf(" \\ ^__^\n");
printf(" \\ (oo)\\_______\n");
printf(" (__)\\ )\\/\\\n");
printf(" ||----w |\n");
printf(" || ||\n");
}
printf("%s", cow);
int main() {
affiche_vache();
return 0;
}

View File

@@ -14,7 +14,7 @@ if [ $# -eq 0 ]; then
((rb < 32742)) && r2=$((rb % 51)) && break
done
result=$((r1 + r2))
message="$r1 + $r2 = $result"
message="$r1 + $r2"
else
expression="$1"
result=$(echo "scale=2; $expression" | bc -l)