有没有看看这个代码的伪代码怎么写😭😭
template<class Type>
void Loading(int x[],Type w[],Type c,int n)
{
int *t=new int [n+1];
Sort(w,t,n);
for (int i=1;i<= n;i++)
×[i]=0;
for(int i=1;i<= n&&w[t[i]]<= c;i++)
{
x[t[i]]=1;
C-=w[t[i]];
}
}
有没有看看这个代码的伪代码怎么写😭😭
template<class Type>
void Loading(int x[],Type w[],Type c,int n)
{
int *t=new int [n+1];
Sort(w,t,n);
for (int i=1;i<= n;i++)
×[i]=0;
for(int i=1;i<= n&&w[t[i]]<= c;i++)
{
x[t[i]]=1;
C-=w[t[i]];
}
}