1005 Spell It Right (20 分)
题解:因为N很大,已经超过long long 范围,所以按字符串读入,然后对每一位进行相加,然后输出对应的英文就可
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
const int N=1e5+10;
const int mod=100000007;
string s;
string a[15]={"zero","one","two","three","four",
"five","six","seven","eight","nine"};
int main(){
cin>>s;
LL sum=0;
for(int i=0;i<s.size();i++){
sum+=s[i]-'0';
}
string t="";
if(sum==0) t+='0';
while(sum){
t+=(sum%10+'0');
sum/=10;
}
cout<<a[t[t.size()-1]-'0'];
for(int i=t.size()-2;i>=0;i--){
cout<<" "<<a[t[i]-'0'];
}
return 0;
}