虽然很简单,但这模拟写的我好累呀! #include <iostream> #include <string> using namespace std; int main() { string s,t; int p,r,ans; while (getline(cin,s) && s!="") { ans=0; r=0; do { p=s.find(" "); t=s.substr(0,p); s=s.substr(p+1); if (t=="negative") cout << "-"; else if (t=="million") { ans+=r*1000000; r=0; } else if (t=="thousand") { ans+=r*1000; r=0; } else if (t=="hundred") r*=100; else if (t=="zero") r=0; else if (t=="one") r+=1; else if (t