是什么区别decimal,float并double在.NET?
什么时候会有人使用其中一种?
当我遇到这个算法(进行更改)并在下面实现它时,我正在网上冲浪...但仍然有任何有效的方法来做到这一点......我怎么能从我实施的程序中找到相同的复杂性...
1>算法如下
makechange(c[],n) //c will contain the coins which we can take as our soln choice and 'n' is the amount we want change for
soln<-NULL//set that will hold solution
sum=0
while(sum!=n)
{
x<-largest item in c such that sum+x<=n
if(there is no such item)
return not found
soln <- soln U {a coin of value x}
sum=sum+x
return soln
}
2>here is what i have tried
#include<stdio.h>
#include<conio.h>
void main() {
int c[]= {100,50,20,10,5,1},soln[6];
int num,i,j,sum=0,x,k,flag=0;
clrscr();
printf("\nEnter amount …Run Code Online (Sandbox Code Playgroud)