跟书上敲的一样,求问题在哪儿
程序代码:
#include <stdio.h> double clear(double sum,double value) { int num; double newsum; num=(int)(sum/value); if (value>1) printf("%f元%d张\n",value,num); else printf("%f角%d张\n",value*10,num); newsum=sum-value*num; return newsum; } int main(void) { double clear(double sum,double value); double sum; double money[7]={100,50,10,5,0.5,0.1}; printf("请输入实发工资总额\n"); scanf("%f",&sum); for (int i=0;i<=5;i++) { sum=clear(sum,money[i]); } }