相关疑难解决方法(0)

.NET中的decimal,float和double之间的区别?

是什么区别decimal,floatdouble在.NET?

什么时候会有人使用其中一种?

.net floating-point double decimal

2015
推荐指数
15
解决办法
88万
查看次数

任何更好的方法来实现这一点

当我遇到这个算法(进行更改)并在下面实现它时,我正在网上冲浪...但仍然有任何有效的方法来做到这一点......我怎么能从我实施的程序中找到相同的复杂性...

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)

c c++ algorithm

-1
推荐指数
1
解决办法
469
查看次数

标签 统计

.net ×1

algorithm ×1

c ×1

c++ ×1

decimal ×1

double ×1

floating-point ×1