1. 程式人生 > >3.1示例程式p33

3.1示例程式p33

#include “stdio.h”
int main(void )
{
float weight ;
float value;
printf(“are you worth in rhodium ?/ n”);
printf(“let`s check it out .\n”);
printf("plese enter your weight in pounds ");
scanf( " %f ", &weight);//不要忘了scanf 要取地址
value = 700 * weight * 14.5833;
printf( "your weight in rhodium is worth $ %0.2f \n ",value);//要用%
printf(“your are easily worth that ! If rhodium prices drop \n”);
printf(“eat more to maintain your value.\n”);
return 0;//return 返回是一個int型別,
}在這裡插入圖片描述