The 5th Zhejiang Provincial Collegiate Programming Contest---ProblemE:Easy Task

来源:互联网 发布:mac玩泡泡堂 编辑:程序博客网 时间:2024/05/16 16:06

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2969

全场第一水题。我不知道怎么解释,看代码就好了。。。

#include<bits/stdc++.h>using namespace std;int main() {    int t,n,a[101];    cin>>t;    while(t--) {        cin>>n;        if(n==0) {            cin>>a[0];            cout<<n<<endl;        }        else {            for(int i=n; i>=0; i--) {                cin>>a[i];                a[i]*=i;            }            cout<<a[n];            for(int i=n-1; i>0; i--)                printf(" %d",a[i]);            cout<<endl;        }    }    return 0;}
0 0