自己不想写了,copy的别人的代码,加了点注释
#include#include using namespace std;string TAB[10]={ "ling ","yi ","er ","san ","si ","wu ","liu ","qi ","ba ","jiu "};string RFState[5]={ "","","Shi ","Bai ","Qian "};string REFState[4]={ "","","Wan ","Yi "};string ReadFunction(string s){ int n=s.size(),i=0,j=0; string ret="";//储存s读的结果 while(true) { i=j; while(j >s; if(s=="0") { cout<<"ling"; return 0; } if(s[0]=='-') { ans+="Fu "; s=s.substr(1); } int n=s.size(),m,k=(n%4==0)?4:n%4;//k记录最开始读的长度,可能不是4的整数 if(n==9) m=3;//分三段读 else if(n>=5) m=2;//分两段读 else m=1;//分一段读 for(int i=m;i>0;i--) { if(i