题解:P15638 [ICPC 2022 Tehran R] Final Price

签到题

题意看起来很复杂,但是通过观察题目样例,发现就是给一些数,求总和。

AC Code

#include<bits/stdc++.h>
using namespace std;
int n,sum; // sum:总和
int main(){
	ios::sync_with_stdio(0);
    cin>>n;
    for(int i=1;i<=n;i++){
        int x;
        cin>>x; // 输入增加值
        sum+=x; // 进行累加
    }
    cout<<sum; // 输出结果
    return 0;
}

::::

posted @ 2026-10-30 16:42  zhouguoyi  阅读(4)  评论(0)    收藏  举报