编辑代码

#include <stdio.h>
void makeChange(int amount) {
    int coins[] = {25, 10, 5, 1};
    int numCoins = sizeof(coins) / sizeof(coins[0]);
    printf("Coins needed for %d cents: ", amount);
    for (int i = 0; i < numCoins; i++) {
        while (amount >= coins[i]) {
            printf("%d ", coins[i]);
            amount -= coins[i];
        }
    }
    printf("\n");
}
int main() {
    int amount = 48;
    makeChange(amount);
    return 0;
}