样例已过,自造数据已过,但还是全WA
查看原帖
样例已过,自造数据已过,但还是全WA
309392
Almond7216楼主2021/1/17 21:51

各位dalao们康康我代码正不正常

#include<bits/stdc++.h>
using namespace std;
long long n,p[1001];
char a[10000];
int main(){
	cin>>n>>a;
	int len=strlen(a),cnt=0;
	for(int i=0;i<len;i++){
		if(a[i]!='0') p[++cnt]=len-1-i;
	}
	for(int i=1;i<cnt;i++){
		cout<<a[p[cnt-i+1]]-'0'<<"*"<<n<<"^"<<p[i]<<"+";
	}
	cout<<a[p[cnt]]-'0'<<"*"<<n<<"^"<<p[cnt];
}
2021/1/17 21:51
加载中...