c语言计算取余不准确问题!请大虾讲解
#include<stdio.h>int main(void)
{
int i;
int j;
int k;
int m;
int n;
int l;
int count;
int temp;
int temp1;
printf("plesase input money:\n");
scanf("%d\n%d\n%d\n%d\n%d\n%d",&i,&j,&k,&m,&n,&l);
count=i*1+j*2+k*5+m*10+n*20+l*50;
printf("ni de qian you %d fen:\n",count);
temp=count/100;
temp1=count%100;
printf("%d yuan\n",temp);
temp=temp1;
temp=temp/10;
printf("%d jiao\n",temp);
temp=temp%10;
printf("%d fen",temp) ;
return 0;
}
如上我是用来计算1分2分5分1角2角5角钱最后多少钱的问题;
最后分钱数总是不对请高手解答