liuchuo / PAT

🍭 浙江大学PAT题解(C/C++/Java/Python) - 努力成为萌萌的程序媛~

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

乙级1056 组合数的和(C++)更优解

arkerdota opened this issue · comments

 #include <iostream>
using namespace std;
int main(){
     int N,sum=0,temp;
     cin>>N;
     for (int i=0;i<N;i++){
        cin>>temp;
         sum +=temp*11*(N-1);
     }
    cout<<sum;
}