From 6dcbcac0923c63e16f84ffaeedda0d993e490dc9 Mon Sep 17 00:00:00 2001 From: zeekling Date: Tue, 5 Oct 2021 22:29:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0platinum.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter3/platinum.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 chapter3/platinum.c diff --git a/chapter3/platinum.c b/chapter3/platinum.c new file mode 100644 index 0000000..e4e6670 --- /dev/null +++ b/chapter3/platinum.c @@ -0,0 +1,16 @@ +#include + +int main(void){ + float weight; + float value; + printf("Are you worth your weight in platinum?\n"); + printf("Let's check is out.\n"); + printf("please enter your weight in pounds:"); + scanf("%f", &weight); + value = 1700.0 * weight * 14.5833; + printf("Your weight in platinum is worth $%.2f.\n", value); + printf("You are easily worth that! If platinum prices drop,\n"); + printf("eat more to maintain your value.\n"); + + return 0; +}