编写c程序
目前人民币有以下几种面值:1元 2元 5元 10元 20元 50元 100元 编写一个c函数计算“X”需要多少张面值为n元的纸币,在主函数中中输入一个金额值,调用该函数,计算组成该金额最少需要多少张纸币。
int getCount(int total) { int count = 0; int a[] = {100,50,20,10,5,2,1}; int i; for(i=0; i a[i]){ printf("%d:%d\n", a[i], total/a[i]); count = count + total/a[i]; total = total % a[i]; } } } printf("总张数:%d\n" + count); return count; }
答:升值和贬值,是国际金融概念,是指人民币与外币的兑换比率,和利率关系不大。 简单说,今天1美圆等于8元人民币,如果明天调整为1美圆等于7元人民币,为升值,反之,就...详情>>