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;
}

 

相关文章:

  • 2022-02-05
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-19
猜你喜欢
  • 2022-12-23
  • 2021-12-30
  • 2022-02-09
  • 2021-07-11
  • 2022-01-26
  • 2021-12-06
  • 2021-08-13
相关资源
相似解决方案