提交时间:2023-08-22 14:17:55
运行 ID: 99227
#include <bits/stdc++.h> using namespace std; int n; int a[114]; signed main() { cin >> n; for(int i = n; i >= 0; i--)cin >> a[i]; for(int i = n; i >= 0; i--) { if(i != n) { if(a[i]>0)cout << '+'; else if(a[i]<0)cout << '-'; else { continue; } } if(abs(a[i])!=1)cout << abs(a[i]); if(i!=0) { cout << "x^"; cout << i; } } return 0; }