求编个程序 谢谢
我是个新手,刚学 .希望大家帮帮我.题目:编写一个程序,提示用户从键盘输入一个星期的薪水(以美元为单位)和工作时数,他们均为浮点数,然后计算并输出每个小时的平均薪水,输出格式为:
Your average hourly pay rate is 7 dollars and 54 cents.
下面是我写的 不知道对不对
#include<stdio.h>
int main(void)
{
float week_hours_work=0.0f;
float week_time_work=0.0f;
float week_salary=0.0f;
float salery_per_hour=0.0f;
float hour=0.0f;
const float RMB_per_dollar=6.7f;
const float hours_per_day=24.0f;
printf("Please enter your salary of one week: ");
scanf("%f",&week_salary);
printf("Please enter your work time of one week: ");
scanf("%f",&week_time_work);
week_hours_work=24.0f*week_time_work;
salery_per_hour=week_salary/week_hours_work;
printf("Your average nourly pay rate is %ld dollars and %.2f cents",salery_per_hour/RMB_per_dollar,salery_per_hour%RMB_per_dollar);
ruturn 0;
}