- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 扩展操作码的编程实现
#include #include #includevoid process(int n){ int tem[4]={0,0,0,0}; int j=0; while (n>=1) { tem[j]=n%2; j=j+1; n=n/2; } for (int m=3;m>=0;m--) pri
2008-10-05 22:58:00 952
原创 饮料最大满意度算法1.6.1
#include #include int h[5]={8,7,6,5,4};int c[5]={6,3,6,2,1};int v[5]={1,2,1,3,6};int opt[7][6];void main(){ opt[0][5]=0; for(int m=1;m { opt[m][5]=-10000; } for (int n=4;n>=0;n--) for (int l=0;l
2008-08-06 21:19:00 400
原创 饮料最大满意度订购问题1.6.2
#include #include int h[5]={15,10,1,1,1};int r[5]={1,2,3,2,1};int c[5]={6,3,2,3,6};int opt[7][6];int cal(int v,int type){ if (type==5) { if (v==0) return 0; else return -10000; } else if (v
2008-08-06 15:43:00 383
原创 编程之美1.4-买书问题-解法2
#include #include void F(int y1,int y2,int y3,int y4,int y5){ int a[5]={y1,y2,y3,y4,y5}; for (int i=0;i for (int j=0;j if (a[j+1]>a[j]){ int t; t=a[j+1]; a[j+1]=a[j]; a[j]=t; } }
2008-07-25 08:26:00 381
原创 编程之美1.4-买书问题-解法1
#include #include float F(int y1,int y2,int y3,int y4,int y5){ int a[5]={y1,y2,y3,y4,y5}; for (int i=0;i for (int j=0;j if (a[j+1]>a[j]){ int t; t=a[j+1]; a[j+1]=a[j]; a[j]=t; } }
2008-07-23 13:22:00 366
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人