#1927: I will give you the answer but one chicken cover(雞包)


1753980-3@g.puiching.edu.mo (P5A31蒲雋浠)

School : No School
ID : 2571
IP address : [192.168.120.33]
Last Login :
2025-03-20 12:13:05
a004. 經濟大恐荒 -- 板橋高中教學題 | From: [192.168.120.33] | Post Date : 2025-04-14 08:27

#include <iostream>
using namespace std;
int main() {
    int num_days, total_money = 0;
    cin >> num_days;
    for (int i = 1; i <= num_days; i++) {
        int buns;
        cin >> buns;
        total_money += buns * i;
    }
    cout << total_money;
    return 0;
}
 
ZeroJudge Forum