#include <vector> #include <string.h> #include <iostream> using namespace std; int main() { int sum=0,j=0; char n[101]; char a[11][6]={"zero","one","two","three","four","five","six","seven","eight","nine"}; vector <int> r; cin>>n; for(int i=0;i<strlen(n);i++) sum+=n[i]-'0'; do { r.push_back(sum%10); j++; sum/=10; }while(sum!=0); cout<<a[r.back()]; r.pop_back(); while(!r.empty()) { cout<<" "<<a[r.back()]; r.pop_back(); } return 0; }
vector真好用啊