```c #include <stdio.h> // 计算最小总等待时间 int calculateMinimumWaitingTime(int n, int t[]) { int totalWaitingTime = 0; int currentWaitingTime = 0; for (int i = 0; i < n; i++) { currentWaitingTime += t[i]; totalWaitingTime += currentWaitingTime; } return totalWaitingTime; } int main() { int n; while (scanf("%d", &n)!= EOF) { int t[4000]; for (int i = 0; i < n; i++) { scanf("%d", &t[i]); } int minWaitingTime = calculateMinimumWaitingTime(n, t); printf("%d\n", minWaitingTime); } return 0; } ``` [2024-10-28 17:18:56 | AI写代码神器 | 202点数解答]