P15638 [ICPC 2022 Tehran R] Final Price

· · 题解

思路

这道题很简单,就是求初始价格加上所有价格变化的总和。

AC Code

#include<bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin>>n;
    long long sum=0;
    while(n--){
        int a;
        cin>>a;
        sum+=a;
    }
    cout<<sum;

    return 0;
}

写于 362134 分,求管理员大大过。