QAQ
先取出末尾的0,对于最后一个不是0的要特殊处理一下
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
char s[99999];
int main()
{
int n;
scanf("%d %s",&n,s);
int len=strlen(s)-1;
int i;
int r=len;
while(s[r]=='0') r--;
for(i=0;i<r;i++)
{
if(s[i]!='0')
{
printf("%c*%d^%d+",s[i],n,len);
}
len--;
}
printf("%c*%d^%d",s[i],n,len);
}