CLearn/Chapter_3/3_1_platinum.c

22 lines
578 B
C

/* platinum.c 计算与自身体重等重的白金价值 */
#include <stdio.h>
int main(void)
{
float weight;
float value;
printf("Are you worth your weight in platinum?\n");
printf("Let's check it 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");
getchar();
getchar();
return 0;
}