求指点??????????????????????
程序代码:
#include double del(double a[],double time,int n) { double minimum; int i,j; minimum=a[0]+n*time; for(i=1;i<N;I++) if(minimum<=a[i]+(n-i)*time) minimum=a[i]+(n-i)*time; return minimum; } int main() { int i,n,j,count=0; double c[100],a[100],temp,b[2]; scanf("%d",&n); while(n) { for(i=0;i<N;I++) scanf("%lf",&a[i]); for(i=0;i<2;i++) scanf("%lf",&b[i]); for(i=0;i<N;I++) for(j=0;j<N-1-I;J++) if(a[j]>=a[j+1]) { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } c[count]=del(a,b[1],n); count++; scanf("%d",&n); } for(i=0;i<COUNT;I++) printf("%g\n",c[i]); return 0; }LK has a question.Coule you help her?
It is the beginning of the day at a bank, and a crowd of clients is already waiting for the entrance door to open.
Once the bank opens, no more clients arrive, and tellerCount tellers begin serving the clients. A
teller takes serviceTime minutes to serve each client. clientArrivals specifies how long each client has already been waiting at the moment when the bank door opens. Your program should determine the best way to arrange the clients into tellerCount queues, so that the waiting time of the client who waits longest is minimized. The waiting time of a client is the sum of the time the client waited outside before the bank opened, the time the client waited in a queue once the bank opened until the service began, and the service time of the client. Return the minimum waiting time for the client who waits the longest.
输入
The input will consist of several test cases. For each test case, one integer N (1<= N <= 100) is given in the first line. Second line contains N integers telling us the time each client had waited.Third line contains tow integers , teller's count and service time per client need. The input is terminated by a single line with N = 0.
输出
For each test of the input, print the answer.
样例输入
2
1 2
1 10
1
10
50 50
0
************
上面代码的思路有没有错误???给点意见。。